How to change the months according to the numbers

if the months are represented with numbers how to change them with the month name
for example - if the column value is 1 then it should change into apr if it 2 then it should change as may etc., likewise it should change

Hi @anjani_priya

Can you share the input file if possible.

Regards

sheet1.xlsx (11.7 KB)
the month should e come in beside column

Hi @anjani_priya

Please correct me if i’m wrong

As per your requirement you need to write as below:

1 - April
2 - May
3 - June
4 - July
5 - August
6 - September
7 - October
8 - November
9 - December
10 - January

Regards

we can get an array with month names by:

So now we setup a formula which picks up with the offset the right name
1 → April, 2 - May…

For test series we evaluate it for all months

so when taking the column value we will parse it into an int32 by
MonthNo = CInt(yourRowVar(ColNameOrIndex).toString.Trim)

and get the month by
MonthName = arrMonthNames((MonthNo + 2) Mod 12)

Hey @anjani_priya
You can also use simple dictionary and switch statement.
New Dictionary(Of Integer, String) From {{1, "April"}, {2, "May"}, {3, "June"}, {4, "July"}, {5, "August"}, {6, "September"}, {7, "October"}, {8, "November"}, {9, "December"}, {10, "January"}, {11, "February"}, {12, "March"}}

Next, in for each data table in ‘switch’ you can use:
CurrentRow("Posting period") = myDictionary(Convert.ToInt32(CurrentRow("Posting period")))

Later on you can use write range to save results to Excel :slight_smile:

here is example of workflow:
BlankProcess72.zip (17.9 KB)

Hi @anjani_priya

I have attached the workflow and output excel please check

Main.xaml (28.7 KB)

sheet1.xlsx (14.9 KB)

Hope it helps!!

my column indexes are different hot to set them?

how can I put that in new column?

@anjani_priya

You can follow the process in the workflow or share the input with column indexes. I will help you out.

Regards

can’t I declare the column names and write the data?

Yes @anjani_priya

If any help need share the input file.

Regards

Hi @anjani_priya

Check out the below zip file:

BlankProcess22.zip (63.5 KB)

sheet1 is your input and Sheet2 is your Output.

Regards

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