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 / Loop through excel to ...
Power Automate
Answered

Loop through excel to get totals based on another column

(0) ShareShare
ReportReport
Posted on by 141

Hello all!

 

I'm fairly new to automation and haven't found a good way to add totals from one column based on the payroll number of another column. 

Our financials department looks at each row of payroll data from a spreadsheet and clears each check out from our financials system. The hurdle I can't get over yet, is the fact that they look at the total number for each payroll and compare it in the financials system before clearing the check. Does anyone know how to loop through Excel and while the payroll is the same number (column H) add the tran amount (column D) to a variable for comparison in the financial system? See screen shot below. 

 

Example: start with payroll 1405 and loop through until it reaches the next payroll number, while doing so, add the tran amounts together. 

 

 

CParsons09_0-1648043319424.png

 

Thank you for your help in advance!

I have the same question (0)
  • Verified answer
    VJR Profile Picture
    7,635 on at

    @CParsons09 

     

    Adding a loop, checking and comparing might take a lot of logic and time to execute the process.

     

    I would suggest you to do a one-time activity of creating a Pivot table.

     

    Pivot can be created either in the same sheet or in the next. Below is in the same sheet.

     

    VJR_0-1648095060752.png

     

    Now you will have the total for each of the Payroll just next to it.

    You can simply read this into a Datatable in PAD and then pass it to the other financial system for verification.

     

    You can also auto refresh the Pivot on open in case there is frequently adding of records to this data.

     

    VJR_1-1648095260672.png

     

  • CParsons09 Profile Picture
    141 on at

    Thank you for that idea! 

    I was able to get a loop created but then realized I over engineered it and took a similar approach to yours, except I extended my power query script to group by payroll then an outer join into another table. This approach is more robust and reduces maintenance cost down the line!

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 411

#2
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 291

Last 30 days Overall leaderboard