web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / convert column number ...
Power Automate
Answered

convert column number to cloumn letter

(0) ShareShare
ReportReport
Posted on by 150

@Deenuji I'm trying to find the Column letter by using Column Index.

 

Example:

Column Index = 6

Column letter = F

I have the same question (0)
  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @kiran_g 

    Please try like below one:

    Syntax: Datatablename.Columns[0]

     

    Flow screenshot:

    Deenuji_0-1711119732940.png

     

    code:

     

    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Deenu\\Dates.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: ExcelInstance ReadAsText: False FirstLineIsHeader: True RangeValue=> ExcelData
    SET fistcolumnname TO ExcelData.Columns[0]

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀. If you'd like to appreciate me, please write a LinkedIn recommendation 🙏

  • kiran_g Profile Picture
    150 on at

    I don't need column Header, i want to know the column letter like A,B,C....

     

  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @kiran_g 

    Are you okay with power fx formula's? 

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀. If you'd like to appreciate me, please write a LinkedIn recommendation 🙏

  • kiran_g Profile Picture
    150 on at

    Yes,  I've also tried vb. net & powershell scripts not working. If possible give me in those scripts

  • Verified answer
    CU16071609-1 Profile Picture
    6,255 Moderator on at

    @kiran_g 

     

    As requested below is the PowerShell scripts for the same.

     

    Flow Screenshot:

    Deenuji_0-1711123027422.png

     

    Only PowerShell Script code:

    # Define a hashtable mapping numbers to alphabets
    $numberToAlphabet = @{
     1 = "A"
     2 = "B"
     3 = "C"
     4 = "D"
     5 = "E"
     6 = "F"
     7 = "G"
     8 = "H"
     9 = "I"
     10 = "J"
     11 = "K"
     12 = "L"
     13 = "M"
     14 = "N"
     15 = "O"
     16 = "P"
     17 = "Q"
     18 = "R"
     19 = "S"
     20 = "T"
     21 = "U"
     22 = "V"
     23 = "W"
     24 = "X"
     25 = "Y"
     26 = "Z"
    }
    
    # Input index
    $inputIndex = %Indexvalue%
    # Check if input index is valid and get corresponding alphabet
    if ($numberToAlphabet.ContainsKey($inputIndex)) {
     $alphabet = $numberToAlphabet[$inputIndex]
     
     Write-Output $alphabet
    }
    else {
     Write-Output "Invalid input index."
    }

    Full PAD flow code:

     

    SET Indexvalue TO 6
    @@copilotGeneratedAction: 'False'
    Scripting.RunPowershellScript.RunPowershellScript Script: $'''# Define a hashtable mapping numbers to alphabets
    $numberToAlphabet = @{
     1 = \"A\"
     2 = \"B\"
     3 = \"C\"
     4 = \"D\"
     5 = \"E\"
     6 = \"F\"
     7 = \"G\"
     8 = \"H\"
     9 = \"I\"
     10 = \"J\"
     11 = \"K\"
     12 = \"L\"
     13 = \"M\"
     14 = \"N\"
     15 = \"O\"
     16 = \"P\"
     17 = \"Q\"
     18 = \"R\"
     19 = \"S\"
     20 = \"T\"
     21 = \"U\"
     22 = \"V\"
     23 = \"W\"
     24 = \"X\"
     25 = \"Y\"
     26 = \"Z\"
    }
    
    # Input index
    $inputIndex = %Indexvalue%
    # Check if input index is valid and get corresponding alphabet
    if ($numberToAlphabet.ContainsKey($inputIndex)) {
     $alphabet = $numberToAlphabet[$inputIndex]
     
     Write-Output $alphabet
    }
    else {
     Write-Output \"Invalid input index.\"
    }''' ScriptOutput=> PowershellOutput

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀. If you'd like to appreciate me, please write a LinkedIn recommendation 🙏

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard