SUMIFs - simple example

Mr2017

Well-known Member
Joined
Nov 28, 2016
Messages
644
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi

I've got a table where I want to add the sum of occurrences for two different letters (see below):

A appears twice, B appears thrice and C appears 4 times.

Assuming that this data covers two columns and 4 rows from cell A1, how would I write a SUMIFS formula that captures the number of occurrences for both A and B, but not C? TIA.

LetterFrequency
A2
B3
C4

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Great, Thanks shift+del - that worked.

Is there an alternative way, though, without using the "{" brackets / parentheses?

I thought there was a simpler way?
 
Upvote 0
You could use
=SUMIF(A2:A4,"A",B2:B4)+SUMIF(A2:A4,"B",B2:B4)
 
Upvote 0
A
B
C
D
1
LetterFrequency
2
A
2​
5​
3
B
3​
4
C
4​

<tbody>
</tbody>

D2=SUMPRODUCT(SUMIF(A2:A4,A2:A3,B2:B4))
 
Upvote 0
Hi Fluff and Marzio

Thank you both for your responses.

I was just wondering, is there a (simpler) way to do it using the SUMIFS (with the 'S' at the end) function?

Thanks in advance.
 
Upvote 0
Three people have now supplied different solutions.
If we knew of a "simpler" formula, don't you think that one of us would have supplied it?
 
Upvote 0
Another way

A
B
C
D
1
LetterFrequency
2
A
2​
5​
3
B
3​
4
C
4​

<tbody>
</tbody>


D2=SUMIFS(B2:B4,A2:A4,"<>"&A4)
 
Upvote 0
Hi Marzio

Quick question - do you know how I can amend your formula if a new record is added to the table?

Eg in the table below, I've added one row of data ( the letter "D" in the first column and the number "5" in the second column).

LetterFrequency
A2
B3
C4
D5

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>

I then amended your formula by adding cell A5 to the not equal clause, but it didn't work, as I guess I'd need to add it somewhere else?

I still want to sum up the data for A and B, but I'd want to be able to exclude new records added to the data. Please let me know if you want me to clarify anything.

=SUMIFS(B2:B5,A2:A5,"<>"&A4,"<>"&A5")
 
Upvote 0

Forum statistics

Threads
1,214,525
Messages
6,120,052
Members
448,940
Latest member
mdusw

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