SUMIF using range from 2 columns

TAPS_MikeDion

Well-known Member
Joined
Aug 14, 2009
Messages
618
Office Version
  1. 2011
Platform
  1. MacOS
Hi everybody,

Can SUMIF be used with a range from 2 columns? I'm trying to have it search columns G & H for a string, and if found, retrieve the totals from column I.

This formula currently works for 1 column (column H), but I also need it to search column G as well.

=SUMIF(H4:H382, "Union Station*",I4:I382)

Thanks for the help!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Is this what you mean?

Book2
GHI
1UnionPlaza10
2TownHall20
3NorthRail30
4SouthRail40
5UnionStation50
6HomePlaza60
7EastStation70
8UnionStation80
9
10130
Sheet1
Cell Formulas
RangeFormula
I10I10=SUMPRODUCT(("Union"=G1:G8)*("Station"=H1:H8)*(I1:I8))
 
Upvote 0
For more than 1 criteria you need sumifs, rather than sumif
Excel Formula:
=SUMIFS(I4:I382,H4:H382, "Union Station*",G4:G382,"???")
 
Upvote 0
If you want to look for the same text in either of the two columns, then perhaps:

Excel Formula:
=SUMPRODUCT(((LEFT(H4:H382,13)="Union Station")+(LEFT(G4:G382,13)="Union Station")),I4:I382)

assuming the text won't be in both columns. If it might be:

Excel Formula:
=SUMPRODUCT(--(((LEFT(H4:H382,13)="Union Station")+(LEFT(G4:G382,13)="Union Station"))>0),I4:I382)
 
Upvote 0
Wow, thank you for so many quick responses!

Unfortunately, as I was trying them all I realized that something else needs to be added to the formula.

Column H would only have "Union Station" as the criteria, but column G would need the "Union Station" criteria along with column H having "Cover Hours" as criteria.

Screen Shot 2022-01-04 at 8.55.04 AM.png
 
Upvote 0
Ok, how about
Excel Formula:
=SUMPRODUCT((H4:H382="Union Station")+((G4:G382="Union Station")*(H4:H382="Cover Hours")),I4:I382)
 
Upvote 0
Solution
Sorry for the very long delay. I was diagnosed with COVID and had been out of work for a week.

First...Fluff buddy, do you ever sleep? LOL

Your formula worked, thank you!
 
Upvote 0
You're welcome & thanks for the feedback.

Hope you have recovered.
 
Upvote 0
Not 100% yet, but close. Thank you. I was lucky enough not to lose taste / smell sensations like many have.
 
Upvote 0

Forum statistics

Threads
1,203,082
Messages
6,053,419
Members
444,662
Latest member
AaronPMH

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