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 / Changing excel number ...
Power Automate
Unanswered

Changing excel number formatting to be accepted in Power Automate

(1) ShareShare
ReportReport
Posted on by 32

Hello,


i have the following issue.
There is an excel script, which creates a table. inside this table i have column (T in my case) which holds the following type of values:
MMDDW_0-1692461176540.png

 

what i want to do is take those values and process them inside power automate. The issue power automate does not read this as a date and when i change the numbering to something else (for example "mm-yyyy") its not reflected in the column. 
When i go inside the cell itself and then press enter it changes to the required format and  i can process this data inside my flow:
MMDDW_1-1692461564902.png

But i cannot do this cell by cell when the input is in the thousands.

Maybe this is something simple, but my excel skills are not great, so my question is -
a) is there a way to auto-refresh all the cells in the specified column so the new formatting is applied
or maybe
b) a solution to my problem inside power automate
I've read this article which describes my predicament and possible solutions perfectly - https://www.exceldemy.com/excel-formatting-not-working-unless-double-click-cell/?fbclid=IwAR1YtX_udc1gZ-vfIMtCU0qPVKZ-pJifVDYjdD-ChOfpJsBJPDvTionNsCM
But unfortunately the Record script action in excel is not able to replicate this action and cant write the syntax necessary on my own.
thanks in advance!
M
Categories:
  • trice602 Profile Picture
    16,668 Super User 2026 Season 2 on at

    Hi @MMDDW ,

     

    You can do this with a quick Office Script and Power Automate flow.  I will give you an example here and the TypeScript to copy and paste in.

     

    trice602_0-1692463514796.png

     

    The first thing you want to do is open up your Excel workbook in a browser because that is the only place you and add an Office Script (as of August 2023).

     

    Click on the Automate tab and then New Script.

     

    trice602_1-1692463642548.png

     

    Here's your TypeScript to cope/paste.

    function main(workbook: ExcelScript.Workbook) {
     let selectedSheet = workbook.getActiveWorksheet();
     selectedSheet.getRange("T:T").setNumberFormat("MM/dd/yyyy");
    }

     

    Replace the default code with yours above.

     

    trice602_2-1692463762648.png

     

     

    Save, Close.

     

    Back to Power Automate.

     

    Here you have a simple trigger button and one action.

     

    trice602_3-1692463834117.png

     

     

    Save and Run.  Results are below.

     

    trice602_4-1692463870008.png

     

     

    This is a great option especially if you have thousands of rows and need a quick solution.

     

     

  • MMDDW Profile Picture
    32 on at

    Hi Tom,

     

    thanks for the reply. 

    This is something I've tried already but it did not work - 

    I trigger the flow, run the script, the table is created but the format has not changed:

    MMDDW_0-1692466472748.png

    this is reflected in power automate as well:

    MMDDW_2-1692466799690.png

     

    its still no accepted as a date format and fails at a later stage:

    MMDDW_3-1692466812502.png

    so i am not sure why excel is not reflecting the changes to the numbering immediately but its whats causing me the issues. 

     

  • trice602 Profile Picture
    16,668 Super User 2026 Season 2 on at

    Hi @MMDDW ,

     

    No worries, you are very close.  When I look at your Office Scripts, you have some extra steps in there that may be the root cause.  In my example, I am just referring to column T.  Please check my code vs. yours, paste in mine, and resubmit please.

     

     

  • trice602 Profile Picture
    16,668 Super User 2026 Season 2 on at

    Hi @MMDDW ,

     

    One more thing:  In my test, with Excel open, I formatted the entire column as a Date MMMM-yyyy (custom value) just like in your original example.  it is possible that these values are strings in the current state.

     

     

  • SamLed Profile Picture
    2,340 Moderator on at

    @trice602 

    Hi Tom,

     

    I did some test, you're last guess looks to be the right one. I've forced data format as text and wasn't able to format it back to date.

     

    Sam

  • trice602 Profile Picture
    16,668 Super User 2026 Season 2 on at

    Thanks @SamLed .  Yeah I was trying to remember the steps I did in testing and when I tried to make my initial column look like @MMDDW , I formatted first.  I think this will work with the extra, manual setup step.

     

     

  • SamLed Profile Picture
    2,340 Moderator on at

    Succeed by using the DATEVALUE formula and giving it the desired format directly from Excel.

  • MMDDW Profile Picture
    32 on at

    @trice602 @trice602 

    indeed the extra step was the key and what @SamLed suggested using DATEVALUE beforehand worked like a charm! 

    Thank you both!

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 211 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 190

Last 30 days Overall leaderboard