=SUMIF - Multiple Pages, Multiple Conditions *PROBABLY SIMPLE!*

sd2173

New Member
Joined
Feb 16, 2011
Messages
31
Good evening all,


So what I am trying to accomplish is summing data from one sheet (DATA for example), on a second sheet (SUMS for example) if specific conditions are met on the data sheet.


I also want to make sure I am summing the data for only the matching number on the SUMS sheet. There will be multiple entries with the same identifying number on the DATA sheet, but only one row for each on the SUMS sheet.


Essentially what I am trying to develop is a formula to drag down the B colum on my SUMS sheet that will do the following for example.


*If SUMS!a2=DATA!A:A and
*DATA!B:B="X"
*DATA!C:C<>"C" and
*DATA!C:C<>"B" and
*DATA!E:E="Q"


Sum the values of DATA!D:D in SUMS!B2 down according to the matching number in the A column of sums. Also making sure if the conditions were not met it sums a "0" not a false or anything.


Below is an example of the sheet layouts and then a "Correct totals" example.

Sheet1: DATA
numberset1set2tosumset3
111xa1q
222xb2q
333xc3q
111ya1
333yb1q
111xc1
222xa2q
222yb2q
333yc2q

<tbody>
</tbody>

Sheet2: SUMS
numbersum
111
222
333

<tbody>
</tbody>

****


Sheet2: SUMS - Correct totals:
numbersum
1111
2222
3330

<tbody>
</tbody>


****


The formula below I've tried putting together which I speculate is way off simply returns 0's in my B:B column in SUMS when placed in B2 and dragged down.


=SUMIF(DATA!D:D,(AND(SUMS!A2=DATA!A:A, DATA!B:B="X",DATA!C:C<>"B",DATA!C:C<>"C",DATA!E:E="Q")),DATA!D:D)


Not having a whole lot of experience with =SUMIF and especially across sheets with multiple conditions I even tried with just one condition with forumla below but same result.


=SUMIF(DATA!D:D,(SUMS!A2=DATA!A:A),DATA!D:D)


It is frustrating because I feel like this should be a simple task and that I have the right idea going in but can't seem to make it work.


I am very thankful for any feedback and suggestions where I may be going astray in my attempts at developing a working formula.


Thank you for your time.


Regards,
SD
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
numbersum
1111=SUMPRODUCT(--(A2=Data!$A$2:$A$10),--(Data!$B$2:$B$10="x"),--(Data!$C$2:$C$10<>"c"),--(Data!$C$2:$C$10<>"b"),--(Data!$E$2:$E$10="q"),Data!$D$2:$D$10)
2222=SUMPRODUCT(--(A3=Data!$A$2:$A$10),--(Data!$B$2:$B$10="x"),--(Data!$C$2:$C$10<>"c"),--(Data!$C$2:$C$10<>"b"),--(Data!$E$2:$E$10="q"),Data!$D$2:$D$10)
3330=SUMPRODUCT(--(A4=Data!$A$2:$A$10),--(Data!$B$2:$B$10="x"),--(Data!$C$2:$C$10<>"c"),--(Data!$C$2:$C$10<>"b"),--(Data!$E$2:$E$10="q"),Data!$D$2:$D$10)
<colgroup><col width="97" style="width: 73pt; mso-width-source: userset; mso-width-alt: 3547;"> <col width="64" style="width: 48pt;"> <col width="1157" style="width: 868pt; mso-width-source: userset; mso-width-alt: 42313;"> <tbody> </tbody>
 
Upvote 0
This looks to suggest I would need to do a different formula for each row in SUMS, is there a formula to paste down, possibly a vLOOKUP that would alleviate this requirement? Else with the actual amount of rows in the SUMS page this would be a lot of work, also, if more than 10 values, can the formulas simply be changed from A2=Data!$A$2:$A$10 to A2=Data!$A$2:$A$A for the respective columns?
 
Upvote 0
Sorry I see now my confusion and this is a formula that can be dragged, I was just confused since you showed it for each cell, which is correct I just was in a different mindset I guess when reading it on the site and not doing in Excel. Much appreciated it seems like it should work great in some trials I am going through now!

;)

Thanks again!

SD
 
Upvote 0
numbersum
1111=SUMPRODUCT(--(A2=Data!$A:$A),--(Data!$B:$B="x"),--(Data!$C:$C<>"c"),--(Data!$C:$C<>"b"),--(Data!$E:$E="q"),Data!$D:$D)
2222=SUMPRODUCT(--(A3=Data!$A:$A),--(Data!$B:$B="x"),--(Data!$C:$C<>"c"),--(Data!$C:$C<>"b"),--(Data!$E:$E="q"),Data!$D:$D)
3330=SUMPRODUCT(--(A4=Data!$A:$A),--(Data!$B:$B="x"),--(Data!$C:$C<>"c"),--(Data!$C:$C<>"b"),--(Data!$E:$E="q"),Data!$D:$D)
It works also with colums only and you can drag it.
<colgroup><col width="97" style="width: 73pt; mso-width-source: userset; mso-width-alt: 3547;"> <col width="64" style="width: 48pt;"> <col width="1157" style="width: 868pt; mso-width-source: userset; mso-width-alt: 42313;"> <tbody> </tbody>
 
Upvote 0

Forum statistics

Threads
1,217,381
Messages
6,136,228
Members
450,000
Latest member
jgp19

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