Check every row and write into another column

Hello there,
i want to check in the column B if there are certain numbers and then write into the column C the month according to that numbers.
For example i have this given in column B:

and now i want for example the first 5 Rows in column C to be filled with the month “January”.
Or from Row 6 to 9 the month should be “February”.
This format is set, so i know how many rows every month should have, but i don´t know how to implement that into UiPath.

this should be the result:
image

Kind regards!

@mcLauge The Values in Column B are they always fixed ?

yes they are

@mcLauge Can you give me the Month Names and it’s Total Weeks Count ?

yes:
January: 5 weeks
February: 4 weeks
March:5 weeks
April:4 weeks
May:5 weeks
June:4 weeks
Juli:5 weeks
August:4 weeks
September:4 weeks
October:4 weeks
November:4 weeks
December: 4 weeks

@mcLauge Check this Workflow :
UpdateMissingData.xaml (11.2 KB)

the workflow is great, but if i try to implement it into my excel file the write range activity doesn´t match the output data table. Do you have any idea on how to do that? Maybe somehow write in every cell of column C the month.

Kind regards!

@mcLauge Can you provide that Input file? Since the Month names and the numbers are matching with each other I thought this would be a better way to create the Excel file using Write Range to a new file and then modify this file :sweat_smile:. In this way you wouldn’t be needing that input file in the first place , but if you want to update that file, Can you tell me if that’s a priority ?

yes, i understand your way of thinking, but i only want, as you mentioned, to update a file :slight_smile: here is the file: Test WK 30.xlsx (9.9 KB)

@mcLauge I have done it using Excel Application Scope. But it takes more time to complete the process. Hence, I avoid using it most amount of time :sweat_smile: But if you’re fine with it, then you can use it or else I’ll figure out an another way.
UpdateMissingData.xaml (10.9 KB)

this works perfectly fine, thank you!
What do i have to do if i want to work with the same scheme, but now with numbers? So now i have the month´s as String (Text) and i want to write the Number of the Month (from 1 to 12) as an Integer in the next column?
Hope you understand :slight_smile:
Should look like this:

Kind regards!

@mcLauge You can use a Write Cell in the same for each loop as I have used the Write Cell for C Column, but in here you would need to specify D Column. Then we can use the DateTime.ParseExact Function to get the Month number from the Month. Check the Screenshot below :

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.