How to remove datetime in the row and replace with N.A.?

How do I remove the data in datetime format (in excel) and replace them with N.A.?

Appreciate for your help!

Hi Catherine, can you explain a little more about what you are trying to achieve? You can overwrite a cell easily enough within an Excel scope. Are you aiming to check a spreadsheet for cells that are formatted as date/time and then insert N.A as text?
Or are you working with a DataTable within UiPath and wanting to remove a column full of dates?
I’m sure we can help!

@JohnMac Hi John, I want to replace the cell that contains date(which is in date format in excel) with “N.A.” as text.

Like this you mean?

This is how you overwrite the cell with N.A using Studio:

@JohnMac Hi John, but there are many rows in the excel, may I know how do I identify which row to insert “N.A.”? I just need the row that contains date to be replaced with “N.A.”

Thank you!

Hello @itsCatherine,

Do the following:

  • Read Range(Read the datatable)
  • For each row, Inside For Each Row activity use IsMatches activity and pass your input as row(“DateTimeRow”).ToString and use the pattern to Match your Date Format (\d{1,2}.\d{1,2}.\d{1,4}) this will give you Boolean value.
  • IF True, Then use Assign Activity like this row(“DateTimeRow”) = “N.A”
    Else, Nothing
  • Write Range, to get your updated excel.