Sumif across multiple rows / range

tntra

New Member
Joined
Feb 8, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello !

I've been trying to find a formula to sum as below, unfortunately sumif does not work as there are multiple rows in my spreadsheet that might keep changing, so I'm looking to create a fixed formula that can sum based on a criteria within the given range.

E.g. based on the chart below, I'd like to sum all the quantities below "Apple" within the entire range.
I've tried =sumif(A1:G1,"Apple",A2:G2) but that only works for one row, I'd need to auto formulate for it to replicate this across the whole range.
The rows are not finite, and new rows might be added within the given range.
Would anyone have a suggestion as to how this can be done?
Thank you!

ABCDEFG
1AppleApplePearGrapeApplePear
2103030102010
3
4AppleAppleApplePearGrapePear
5202010303030
6
7ApplePearPearGrapeAppleApple
8303020101020
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Welcome to the Forum!

You can use SUMIF:

Book1
ABCDEF
1AppleApplePearGrapeApplePear
2103030102010
3
4AppleAppleApplePearGrapePear
5202010303030
6
7ApplePearPearGrapeAppleApple
8303020101020
9
10SUM170
Sheet5
Cell Formulas
RangeFormula
B10B10=SUMIF(A1:F7,"Apple",A2:F8)

Important caveat: the formula assumes the headers and the values will never match.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,611
Messages
6,120,509
Members
448,967
Latest member
screechyboy79

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