IF/MATCH statement that includes the SUM

Robert_Conklin

Board Regular
Joined
Jun 19, 2017
Messages
173
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I am in need of an Excel formula that looks to see if cells in column A match. If they do, then provide the sum of all of the cells that match in that group in the first cell of that group in the appropriate column (GA = column "G", "FL" = column "I"). You can see the totals in columns G and I for each group, these are what I need to be auto-summed.

TEST INFO.xlsx
ABCDEFGHI
1STATEMILEAGETOTALFUEL COSTGAGA FUELFLFL FUEL
2601549
3GA601800251$ 200.00251251 
4FL60185050$ 600.00 501150
5FL6029001050 1050
6FL60295050 50
7GA60300050$ 420.0050350 
8GA603100100100 
9GA6031505050 
10GA6032005050 
11GA6032505050 
12GA6033005050 
13FL60335050 50100
14FL60340050 50
15-603400FALSEFALSE
160FALSEFALSE
170FALSEFALSE
180FALSEFALSE
190FALSEFALSE
200FALSEFALSE
210FALSEFALSE
220FALSEFALSE
230FALSEFALSE
240FALSEFALSE
250FALSEFALSE
260FALSEFALSE
270FALSEFALSE
TEST INFO
Cell Formulas
RangeFormula
C3:C27C3=(B3-B2)
F3:F27F3=IF(A3="GA",C3,IF(A3="FL",""))
H3:H27H3=IF(A3="FL",C3,IF(A3="GA",""))
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
C3 can equal =IF(A3="","",B3-B2)
F3 can equal =IF(A3="GA",C3,"")
H3 can equal =IF(A3="FL",C3,"")

If you want totals then
=Sumifs(F:F,A:A,"GA") for GA and =sumifs(H:H,A:A,"FL")
placed where you would like to see them.
 
Upvote 0
@dermie_72, thank you for the assistance. Yes that formula works great if I need a total sum for ALL of the GA and FL items. What I need is to be able to get the total for the GAs and the FLs for just the small groups that are together. If you look in my example above, row three has a single GA. The total for that line is 251 in column G. The next group has three FLs. The total for that group is 1050 in column I. I need the total to only include the small groups, not the entire total. Is this even possible?
 
Upvote 0
How about in G3 copied down
Excel Formula:
=IF(AND(A3="ga",A2<>"ga"),SUM(C3:INDEX(C3:C100,XMATCH(TRUE,A3:A100<>"ga")-1)),"")
 
Upvote 1
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,143
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