Sum of data !!!

G21

New Member
Joined
Oct 17, 2010
Messages
26
HI ,
Im having a requirement to add values in a column according to the data combination in other two columns.

eg-
X A 10
X C 12
X B 11
y A 89
y A 23

in above example , i want to get a sum of values of all X excluding X-B combination. ( So X-A & X-C combinations will get sum up)

Thanks in advance,
G
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
HI ,
Im having a requirement to add values in a column according to the data combination in other two columns.

eg-
X A 10
X C 12
X B 11
y A 89
y A 23

in above example , i want to get a sum of values of all X excluding X-B combination. ( So X-A & X-C combinations will get sum up)

Thanks in advance,
G
This one will work in any version of Excel:

=SUMPRODUCT(--(A2:A6="X"),--(B2:B6<>"B"),C2:C6)

This one will work in Excel 2007 and later:

=SUMIFS(C2:C6,A2:A6,"X",B2:B6,"<>B")
 
Last edited:
Upvote 0
HI All,
Thanks for the quick response. All solutions are working.snoopyhr , your solution count all X & Y together. I need one a time.

Now need one more thing for the same. Need this equation as VBA statement to include to a macro with the specific sheet name.

RGDS,
G
 
Upvote 0
HI,
i need to convert the below formula in to VBA statement to run with Excel Macro. pls advise...

=SUMIFS(IP_SPACE!I5:I100,IP_SPACE!B5:B100,"x:",IP_SPACE!F5:F100,"<>BLANK")

Thanks & RGDS,
G
 
Upvote 0
HI All,
Got it resolved. Thanks for the support....worked the code as..

HTML:
ActiveCell.FormulaR1C1 = _
        "=SUMIFS(IP_SPACE!R[2]C[3]:R[97]C[3],IP_SPACE!R[2]C[-4]:R[97]C[-4],""x:"",IP_SPACE!R[2]C:R[97]C,""<>BLANK"")"

Thanks & RGDS,
G
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

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