Combining SUMIF & LEFT functions based on numeric values

romtoss

New Member
Joined
Nov 29, 2016
Messages
9
Hello -

I'm trying to write a SUMIF formula based on the criteria that my column starts with a certain character. My formula seems to work if the column I'm basing it off of is text, but it does not work for numeric values which is my problem.

Below is a table I have my in spreadsheet showing Sales Location ID in column B and Product Sales in column C. (This information is in a pivot table so I don't believe I can change the values or their format.) Below is my formula:

=SUMIF($B$6:$B$19,"1*",$C$6:$C$19)

If the "1*" was text (let's say "A*" and my values in column B started with letters, sometimes A), the formula would work. But I cannot get it work with the numeric values below. Is this possible to do? I tried using the TEXT function within my formula but haven't had any luck either, but perhaps I just have the syntax wrong?

Sales Location IDProduct Sales
0​
0.00​
100​
1,546,559.62​
200​
763,188.86​
300​
107,983.83​
400​
601,535.34​
500​
587,383.30​
600​
701,949.58​
700​
168,568.16​
4,477,168.69​
112​
(350.00)​
117​
11,045.20​
315​
368.38​
316​
(6.41)​
320​
(750.00)​
10,307.17​
4,487,475.86​
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
How about
=SUMPRODUCT((LEFT($B$6:$B$19,1)="1")*(C$6:$C$19))
 
Upvote 0
How about
=SUMPRODUCT((LEFT($B$6:$B$19,1)="1")*(C$6:$C$19))

This worked perfectly! Thank you! I haven't really used SUMPRODUCT before, so I never thought of that as an alternative. I'm gonna go read up on that function now. Appreciate your help!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,462
Members
448,965
Latest member
grijken

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