Cumulative sum with multiple criteria

camilaarbigaus

New Member
Joined
Apr 17, 2024
Messages
5
Office Version
  1. 2016
Platform
  1. Windows
Hi all, I am trying to calculate the percentiles in a frequency table, but I'm having trouble creating the cum sum with multiple criteria - the idea is to replicate the values in column D

StateColorCountCum. sum for "blue" per state
AlabamaBlue22
AlabamaYellow4
AlabamaBlue68
AlabamaRed8
AlabamaRed10
AlaskaYellow11
AlaskaBlue33
AlaskaRed4

I was able to calculate the cum sum per color, but not accounting for state with the following formula (in google sheets - and I don't know if this is the best way as I'm finding some errors in the way):
=IF(B2<>"Blue","",c2+ArrayFormula(LOOKUP(2,1/(ISNUM(D$1:D2)),D$1:D2)))

Does anybody have any idea on how to do it? With the cumulative sum, I'll be able to calculate the percentiles per state per color

Thnak you very much!!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Maybe
Excel Formula:
=IF(B2<>"Blue","",sumifs(c$2:C2,A$2:a2,a2,B$2:B2,"Blue"))
 
Upvote 1
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,880
Messages
6,175,157
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top