Calculate the first four cells based on condition

addy_89

New Member
Joined
Jul 9, 2014
Messages
21
ABCD
x16-03-20142
x16-03-20143
x16-03-20144
x16-03-20145
x16-03-20146
x17-03-20147
x17-03-20148
x17-03-20149
x17-03-201410
y17-03-20141

<colgroup><col><col><col span="2"></colgroup><tbody>
</tbody>


In the above example, i want to sum the first four cells where data in column a and column b is matching and after summing the first four values, i want excel to sum the rest of the values for the matching data in column in a and b which not necessary would be 4, but will be less. I have the written the array formula for this using count if and sumifs but that is giving me the sum of total values.

{=IF(COUNTIFS($A$2:$A3,A3,$B$2:$B3,B3)>1,"",SUMIFS(C:C,A:A,A3,B:B,B3))}

Is it possible? Please help, i'm stuck :(
 
I've tried a couple of things to do this with a formula, but so far it is not working.

To be honest, I don't think that it is possible, at least not with a formula, or if it is, it's beyond my level of knowledge.
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I've tried a couple of things to do this with a formula, but so far it is not working.

To be honest, I don't think that it is possible, at least not with a formula, or if it is, it's beyond my level of knowledge.


Thanks for the help though :) Please let me know if anything is possible. :)
 
Upvote 0
Possibly, but for me writing it would be more trial and error than knowledge.
 
Upvote 0
Best I can do, it works, but slow to calculate.

=IF(SUM(D$1:D1)>SUM(C$1:C1),"",LOOKUP(40000,SUMIFS(OFFSET(C2,,,{1,2,3,4}),OFFSET(A2,,,{1,2,3,4}),A2,OFFSET(B2,,,{1,2,3,4}),B2)))
 
Upvote 0
AWESOME!!..That worked!!...You 're the man :D

One more thing and probably the last one, can i sum the values on another coloum based on the results for above formula? like

ab400004400004
ab360005360005
ab50006590030
ab5007BlankBlank
ab4008BlankBlank
ab3009BlankBlank
cd40000104000010
cd36000113600011
cd600012690039
cd50013BlankBlank
cd40014BlankBlank

<colgroup><col><col><col><col><col span="2"></colgroup><tbody>
</tbody>
 
Upvote 0
Use the same formula, just change the columns to reflect the new ranges.
 
Upvote 0

Forum statistics

Threads
1,215,416
Messages
6,124,772
Members
449,187
Latest member
hermansoa

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