SUMIFS and looking at the left 2 characters or using a wildcard only return "0"

JDUNNAGAN

New Member
Joined
Dec 10, 2014
Messages
13
Hello all,

I am working on creating an executive dashboard. I need to sum the total spend for all budget codes by department and company. Unfortunately the department does not come through into the report but the budget codes does. There are at a minimum 20 budget codes per department. So I didn't want to try and build in every budget code since these will and do change. So I have two options based on my skill level that I could see. I can look at the first two characters of the budget code since that identifies the department. Or instead of looking at the first two characters I could use a wild card to get this thing working. Both of the formulas I am using only return a 0, which would be okay if there were no dollars matching the criteria but there are.

The 2 formulas I have been using.
=IF(LEFT('BILL DETAIL BY ACCOUNT YTD'!Z:Z,2)="25",SUMIFS('BILL DETAIL BY ACCOUNT YTD'!P:P,'BILL DETAIL BY ACCOUNT YTD'!W:W,"1"),"0")
=SUMIFS('BILL DETAIL BY ACCOUNT YTD'!P:P,'BILL DETAIL BY ACCOUNT YTD'!W:W,"1",'BILL DETAIL BY ACCOUNT YTD'!Z:Z,"="&"25*")

SIDE NOTE: I tried the formula within 1 worksheet instead of referenceing back to another worksheet within the formula and the formula worked. Now I'm really confused!!

Any help would be really appreciated.

Regards,
JD
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,138
Try...

=SUMPRODUCT('BILL DETAIL BY ACCOUNT YTD'!P:P,--('BILL DETAIL BY ACCOUNT YTD'!W:W=1),--(LEFT('BILL DETAIL BY ACCOUNT YTD'!Z:Z,2)="25"))
 

Forum statistics

Threads
1,082,588
Messages
5,366,490
Members
400,895
Latest member
shumcal

Some videos you may like

This Week's Hot Topics

Top