SUMIFS and Wildcard

Simonc64

Active Member
Joined
Feb 15, 2007
Messages
251
Office Version
  1. 365
Hi all, Ive researched this problem here without an exact answer to my problem so oping you can help!

I have a s/sheet with the following........

Column A contains Job Titles

Column B contains Salary Cost

Column C contains Cost Centres

What I want to do is very simple ie sum the "salary cost" based on job title for specific cost centres - the problem is that several cost centres contain the same job title.

My approach was

=SUMIFS($B:$B,$A:$A,$A$25,$C:$C,"*08*")

Thining that this would sum the costs for all job titles (A25) where the cost centre starts with 08 but it doesnt! Any help gratefully received.

Thanks
 

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.
Hi all, Ive researched this problem here without an exact answer to my problem so oping you can help!

I have a s/sheet with the following........

Column A contains Job Titles

Column B contains Salary Cost

Column C contains Cost Centres

What I want to do is very simple ie sum the "salary cost" based on job title for specific cost centres - the problem is that several cost centres contain the same job title.

My approach was

=SUMIFS($B:$B,$A:$A,$A$25,$C:$C,"*08*")

Thining that this would sum the costs for all job titles (A25) where the cost centre starts with 08 but it doesnt! Any help gratefully received.

Thanks

Care to post a few entries from column C?
 
Upvote 0
Hi Aladin

Quite simply column C would contain entries such as 08750, 11000, 12801 etc but all will contain "sales manager" as a job title - all I want to do is sum the salary costs by cost centre by job title, but use the wildcard to distinguish between cost centres
 
Upvote 0
thanks also Dan - that site has been blocked by my webmaster so will check it out at home later.
 
Upvote 0
As per Aladin, if you can post an example of your worksheet, would make it easier. As a guess (you may need to modify), try:
Rich (BB code):
=SUMPRODUCT(--(LEFT(C:C,2)="08"),--(A:A=A1),--(B:B=B1))
Bits in red you may need to change but see if that helps
 
Upvote 0
I think your formula should work, provided that Column C contains text values i.e. '08750 not numbers such as 8750 formatted "00000" to display a leading zero.

If it is only the cells beginning 08 you need then use ...

=SUMIFS($B:$B,$A:$A,$E$1,$C:$C,"08*")

Using "*08*" will count e.g. '09108 in your calcs.
 
Last edited:
Upvote 0
Hi Aladin

Quite simply column C would contain entries such as 08750, 11000, 12801 etc but all will contain "sales manager" as a job title - all I want to do is sum the salary costs by cost centre by job title, but use the wildcard to distinguish between cost centres

If 08750, etc. are text, the leading 0 is a real-estate text-digit, the formula you have should succeed...
Do you get wrong figures or just a 0 result?
 
Upvote 0
Agreed. That was my conclusion in Post#8

If there are numbers, or indeed a mix of real numbers and numbers as strings this might be safer
Code:
=SUMPRODUCT($B$2:$B$20*($A$2:$A$20=[COLOR=#ff0000]$F$1[/COLOR])*(INT($D$2:$D$20/1000)=8))

Replace $F$1 with $A$25, similarly with $E$1 in Post #8

Don't apply SUMPRODUCT() to a whole Column, it will fail in 2003 and perform over a million unnecessary calculations in 2007 and above.
Always limit the range size, I prefer to use Dynamic Named Ranges where possible whenever I use this function
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,626
Messages
6,120,602
Members
448,974
Latest member
ChristineC

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