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 / How to make count of u...
Power Automate
Answered

How to make count of unique cells values in Excel column?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello all,

 

Just a beignner in Power Autoamte Desktop - initally tried to solve this issue using cloud Flows, but then saw taht there's very useful feature "Read from Excel worksheet" in Desktop Flow , so trying to understand if it's possible to achive  following:

 

  • Flow to open spreadsheet, read values from specific column, let's say Column A
  • In that columns, there would be alwasy only 2 values - let's say "Yes" and "No"

Is it possible to make count of how many cells have "Yes" value and how many have "No" , and then save these 2 as variables or as values (like equivalent of cloud Flow "Compose") to use later / send to other tool (SharePoint or else)?

 

Appreciate any ideas.

  • tkuehara Profile Picture
    667 on at

    Hi @vbvbvb 

     


    @vbvbvb wrote:

    trying to understand if it's possible to achive  following:

     

    • Flow to open spreadsheet, read values from specific column, let's say Column A
    • In that columns, there would be alwasy only 2 values - let's say "Yes" and "No"

    Is it possible to make count of how many cells have "Yes" value and how many have "No" , and then save these 2 as variables or as values (like equivalent of cloud Flow "Compose") to use later / send to other tool (SharePoint or else)?

     

    Yes, it is possible to open spreadsheet and read values from specific column. Example:

     

    tkuehara_0-1625583388020.pngtkuehara_1-1625583403419.pngtkuehara_2-1625583437442.png

    As for the second question, you could create a simple "if/switch" statement:

    tkuehara_3-1625583745861.png

    Please note this is just a sample, your logic might need to be more complex in order to accomplish your desired result.

     

  • vbbvbb Profile Picture
    Microsoft Employee on at

    Perfect , thanks a lot @tkuehara  - after cloud Flows, this is all a bit 'new' to me , so apreciate the sample, I will have to look at these For Each actions to adapt them to my logic.  For example instead of Add Item to List , it can be Set Variable  for value "Yes" and value "No" and then Increment variable for each of them instead I guess to come to a final sum of each of them?

  • Verified answer
    tkuehara Profile Picture
    667 on at

    Indeed @vbvbvb ! You can create two variables and then increase them:

     

    tkuehara_0-1625584387961.png

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    After launch Excel and retrieve the desired range I think this flow is more suited to get Yes and No counts:


    'Set variable' - call variable %YesCount% and set it to 0

    'Set variable' - call variable %NoCount% and set it to 0

    For each %CurrentItem% in %ExcelData%:

    'If' %CurrentItem% = 'Yes' then

    'Increase variable', where Variable name = %YesCount% and Increase by = 1

    'Else'

    'Increase variable', where Variable name = %NoCount% and Increase by = 1
    'End'

    'End'

    At the end, just get %YesCount% and %NoCount% variables.

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 315 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 267

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard