=SUMIF() question : can the criteria be a range of things?

Richard1982

New Member
Joined
Jul 6, 2022
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hello,

Apologies is this is a silly question... but can the criteria in a SUMIF() be a range of values? For example I have:
Excel Formula:
=SUMIF(A1:A100,7000,B1:B100)
I have a list of product codes in column A and values in column B - I'm looking for product code 7000. All the 7000's are added up and so I know the total, that bit is good.

But now I want a total of everything between 7000 and 7413. Is there someway to make that? Something like this (although obviously this doesn't work):
Excel Formula:
=SUMIF(A1:A100,7000:7413,B1:B100)

At the moment I have the 7413 lines and just sum them up but I'm sure there must be a way to just have a one line formular that add it all up! Any help would be greatfully received!

Richard
 

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.
Perhaps
Excel Formula:
=sumifs(B1:B100,A1:A100,">7000",A1:A100,"<7413")
 
Upvote 0
Solution
Ah thank you Arthur - simple when you know how! I'm kicking myself for not thinking of this.

Thanks for your help!
 
Upvote 0
Try

Excel Formula:
=SUMPRODUCT(0+(A1:A1000>"7000"),0+(A1:A1000<"7413"),B1:B1000)

Regards

Murray
 
Upvote 0
Or,

enter required product code in a range, eg: C2:C50, then use

=SUM(SUMIFS(B1:B100,A1:A100,C2:C50))
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,155
Members
453,021
Latest member
Justyna P

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