SUMIF and Search

Super Mario

New Member
Joined
Dec 14, 2022
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi,
I'm struggling to figure out why this formula wont work, thought this would be an easy one for me!

I have a quarterly budget against business unit projects, several projects per business unit that I want to summarise. Q1 to Q4 budgets for each project listed in columns L to O. The criteria range is column J and the criteria is column A.

In the summary table, I want to sum the projects by BU in column C. Now I want to change the sum of budget by changing the quarter I'm viewing by a data validation list in cell B1. List is FY24 Q1, FY24 Q2, FY24 Q3, FY24 Q4.

The problem I have is that when I change the quarter in cell B1, the formula errors out and I can't seem to fix this. (so it works only with FY24 Q1 is selected, but not for any other quarters). If I'm missing a simple correction, or if there is a better set of formulas to use then I would really appreciate some help with this.

=IF(SEARCH("Q1",B1,1),SUMIF(J2:J13,A5,L2:L13),IF(SEARCH("Q2",B1,1),SUMIF(J2:J13,A5,M2:M13),IF(SEARCH("Q3",B1,1),SUMIF(J2:J13,A5,N2:N13),IF(SEARCH("Q4",B1,1),SUMIF(J2:J13,A5,O2:O13),"error"))))

Many thanks.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
What exactly are the headers in L1:O1? The simplest way will be some sort of INDEX/MATCH combination like:

Excel Formula:
=SUMIF(J2:J13,A5,INDEX(L2:O13,0,MATCH(B1,L1:O1,0)))
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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