Convert Column index to column letter

Hey everyone,

I have a pretty simple question but couldnt find a way to do.

I get the column index as “columnIndex” variable, it could be 0 which is ‘A’ or could be 3 which is ‘D’ etc.

ı need something to change this to letter for example if the column index is 0 I want to save it as A or if its 1 I want to save it as B.
Any suggestions?

@jntrk
have a look on the activity from below:
grafik

EDITED:
Now we do have the option
grafik

3 Likes

robot will work unattanded and this package is not in the orchestrator… :frowning:

Is there any different way?

@jntrk
can not make out the relation from unattended bot and including the package by dependency manager. Maybe you have to configure the feeds e.g. by:

in case of you have less then 26 cols give a try on
chr(65 + ColIndex)
grafik

EDITED:
Now we do have the option
grafik

1 Like

image

It doesnt get resolved, that how its set up in work.

Addition to your other solution there are actualy around 34 column :slight_smile: so thats not viable for me as well I guess.

@jntrk
still you could download the package (within the version compatible) to your project and manually upload to ORC

Also have a look here on a snippet from marketplace:

EDITED:
Now we do have the option
grafik

1 Like

Made a workaround like this is it correct?

@jntrk
could be a solution.
but make the bot more solid, so checkout the referenced snippet is advised.

EDITED:
now we do have the option:
grafik

@jntrk …please check this page…

Hey @jntrk

hi Mate - to resolve your problem instead of third party dependency you can also achieve it in studio itself.
you can refer my very old sample(posted in 2017) link on the forum. let me know if you will face any error.

Regards!!
Aksh1Yadav

2 Likes

Hi @aksh1yadav ,
Hope you are doing well.
I downloaded your solution Excel_Column_Name_mapping.xaml . But according to my project requirement column B must be 1. Could you please suggest any modification in the current solution.
Thanks in advance.

use UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter

e.g.
UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(13) = “M”

1 Like

Hi @jack.chan thank you for your reply.
What my requirement is that if i give ‘1’ in UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(13) here instead of 13 I should get B. Likewise for 2-c,4-d. Could you please suggest if that is possible

yes ,

btw if you give 1 you get “A” , not B
2 gives B
3 gives C
and so on

It will as mentioned by Jack

You also can prototype it within the immediate panel
grafik

and vica versa
grafik

So we are happy nowadays ( it was a later time introduced by UiPath) that we can do it directly

1 Like