Sum consecutive cells that meet criteria

Priya006

New Member
Joined
Aug 18, 2017
Messages
2
Sum consecutive cells that meet criteria
Please provide the excel formula for the below criteria
excel formula for sum of the Amount values when same price occurs consecutively till the next change of price


Actual

Price Amount
2 100
2 100
4 220
5 280
2 300
2 300

Expected

Price Amount result
2 100 200
2 100 200
4 220 220
5 280 280
2 300 600
2 300 600
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
The following formula gives me a count of runs:
=SUMIFS($C$10:$C$14,$G$10:$G$14,"="&G10)
confirmed with ctrl+shift+enter.

Amount = C10 to C14
Price= G10 to G14

But the above formula it will sum up amount values for all the price value which is equal to 2
 
Upvote 0
EF
ChangeResult

<tbody>
[TD="align: center"]1[/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]200[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]200[/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]220[/TD]

[TD="align: center"]5[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]280[/TD]

[TD="align: center"]6[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]600[/TD]

[TD="align: center"]7[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]600[/TD]

[TD="align: center"]

[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>

Formeln der Tabelle
ZelleFormel
F2=SUMIF($E$2:$E$8,E2,$B$2:$B$8)
E3=IF(AND(IF(A1=A2,TRUE,A2=A3),IF(A2=A3,TRUE,A3=A4)),E2,E2+1)
E21

<tbody>
</tbody>

<tbody>
</tbody>


Excel Tabellen im Web darstellen >> Excel Jeanie HTML 4.8
 
Last edited:
Upvote 0
@ mart37

In your cell E2 ... why not =IF(ROW()=2,1,IF(A2=A1,E1,E1+1))
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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