Sum data if it meets criteria on different lines/columns

jdramire

New Member
Joined
Feb 7, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello, this is my first post here but this seems to be a friendly place. I currently have data from our reporting software sending information that is helpful to read, but not to analyze. Right now I'm trying on another tab to calculate the field if it matches two criteria. Those are if the project name matches "362 - General Admission Operations" and if the line is "Total Revenues". This value that I'm looking for is highlighted below in green.

I can currently use a SumIfs formula to calculate, but only if I use a formula to copy "362 - General Admission Operations" to be inline with "Total Revenues". Thanks for any help you can provide happy to update if there are any questions. There are around 250 projects total and several reports to generate. Otherwise I would just copy this information and use the SumIfs.

1675797637791.png
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hello,

With the assumption your Text is located in Column B .... and the targeted Amount is in Column G
Excel Formula:
=INDIRECT("G"&MATCH("Total Revenues",INDIRECT("B"&MATCH("362 - General Admission Operations",B:B,0)+1&":B100"),0)+MATCH("362 - General Admission Operations",B:B,0))
 
Upvote 0
Welcome to the MrExcel forum!

One option:

Book1
ABCDEFGHI
1362 - General Admission Operations Sum of 362 - General Admission Operations
2Revenues$ 329,800.00
3
41234Admissions Income$ 300,000.00
512341234Transaction Fee Revenue$ 28,000.00
6
7Total Revenues$ 328,000.00
8
9123 - Something else
10Revenues
11
121234xxx$ 1,234.00
1312341234yyy$ 5,678.00
14$ 6,912.00
15Total Revenues
16
17362 - General Admission Operations
18Revenues
19
201234Admissions Income$ 500.00
2112341234Transaction Fee Revenue$ 600.00
222345Bonus$ 700.00
23Total Revenues$ 1,800.00
Sheet4
Cell Formulas
RangeFormula
I2I2=LET(f,FILTER(A1:G23,ISNUMBER(MATCH(B1:B23,{"362 - General Admission Operations","Total Revenues"},0))),s,SEQUENCE(ROWS(f)-1),SUM(IF(INDEX(f,s,2)="362 - General Admission Operations",INDEX(f,s+1,7))))
 
Upvote 0
You guys rock thanks for this answer. I mean it was so simple why didn't I think of it? I'll try both solutions and update if they work
 
Upvote 0
I wouldn't say it was especially simple. It definitely required using a few tricks that you might not have seen yet. One thing you should probably be aware of though. James006's suggestion will work if you only have 1 entry for 362. If you have 1 or more, then use mine. When you mentioned SUMIFS, I assumed more than 1 entry, but now I see that may not be the case.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,205
Members
452,618
Latest member
Tam84

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