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 Automate
Suggested Answer

Calculations in Excel

(1) ShareShare
ReportReport
Posted on by 4
Hi Everyone,
 
Is there a way to use power automate to perform calculations?
 
Each morning I go around to several different wastewater discharge meters and record their values in a Microsoft form. When I submit the form, power automate adds the data to a list in Sharepoint and adds a new line in a similar excel document. I then subtract yesterdays numbers from the numbers I recorded today. For example, if yesterday the value was 12345 and today it's 12456, I would subtract the two to find my discharge volume. These calculations are done on a separate table within the same excel file (essentially on a table in a new tab). Is there a way to automate these calculations using power automate? That way when I submit the form and the data is added to excel, the subtraction is done automatically?
 
If power automate cannot do this, does anyone have a better suggestion to try and automate this process?
Categories:
I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,069 Moderator on at
     
    Yes, this can be automated. There are three supported approaches, depending on complexity and maintainability.
     
    Recommended Option (Simple and Reliable)
    Keep calculations inside Excel, let Power Automate just add rows
         Put a formula in the Excel calculation column that subtracts the previous day’s value.
         Excel automatically applies the formula to new rows added by Power Automate.
     
    How to do it?
         Store Excel in SharePoint or OneDrive.
         Use a structured Excel Table.
         Add a formula column such as:
              Excel Cell=[@TodayReading] - XLOOKUP([@MeterID]&[@Date]-1,Table[MeterID]&Table[Date],Table[Reading])
         Power Automate uses Add a row into a table only.
         Excel does the math automatically for each new submission.
     
    Best practice for recurring calculations
    Easy to maintain
    No Flow complexity
     
    Alternate Option 1 – Calculate inside Power Automate
    Power Automate fetches yesterday’s value and subtracts it before writing to Excel.
    How to do it?
         Use List rows present in a table (filter yesterday + same meter).
         Use expression:
              sub(float(today), float(yesterday))
         Save result as a static value in Excel.
    Works without Excel formulas
    More complex flow logic
     
    Alternate Option 2 – Office Scripts (Advanced)
    Use Office Scripts to run Excel logic like a macro from Power Automate.
    How to do it?
         Create a script in Excel that calculates differences.
         Call it using Run script action.
    Best for complex Excel models
    Requires scripting knowledge
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.
  • AS-15041544-0 Profile Picture
    4 on at
    Hi Sunil-Thank you for your reply. I am unfamiliar with the Xlookup function. Can you please elaborate on that a little more? Unfortunately the data is not continuous. Some meters are checked Monday through Friday while others are checked 7 days a week. So there are gaps in the data. Would that create an issue when using the xlookup function

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 881

#2
Valantis Profile Picture

Valantis 823

#3
Haque Profile Picture

Haque 485

Last 30 days Overall leaderboard