Trouble calculating from a column for a set of criteria from another column

kristinerna

New Member
Joined
Jun 28, 2011
Messages
2
I am trying to find a function that calculates a total from a column (D) corresponding to set of criteria (more than two) from another column (A). F.ex. I need the total for keys (col. A) 1100, 1110, 131001-131012 (total -309.000) without adding any of the values in between. Or for just 1110 and 131001-131012.

I have tried to use a few formulas, none of whom work;


=SUM(LOOKUP(1000; A1:A260; D1:D300); LOOKUP(1010; A1:A300; D1:D300))
This adds these two values correctly but doesn’t work with ranges.


=SUMPRODUCT(--(A5:A260>=1100); --(A5:A260<=1110); --(D5:D260))
This one works when done for one range, but when I try to add more than one range:


=SUMPRODUCT(--(A5:A260>=1100); --(A5:A260<=1110); --(D5:D260); --(A5:A260>=131001); --(A5:A260<=131012); --(D5:D260))
OR:
=SUMPRODUCT(--(A5:A260>=1100); --(A5:A260<=1110); --(A5:A260>=131001); --(A5:A260<=131012); --(D5:D260))
These yield 0.
I have also tried using these in combination with =SUM(… and =SUMIF/S(… but either it doesn’t work or I am doing something wrong.
Below is an example of the table the fits the criteria above (I am working from a larger table)


35nc37p.jpg




I am running 32-bit Excel from Microsoft Office Professional Plus 2010 on Windows 7.


I would really appreciate all the help I can get on this.
Kristin
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Welcome to MrExcel.

Try:

=SUMPRODUCT(((A5:A260=1100)+(A5:A260=1110)+((A5:A260>=131001)*(A5:A260<=131012))),D5:D260)
 
Upvote 0
Thank you!
I've tested your formula on every variation I can think of and it works every time.
I am so glad i found this page.

Gratefully,
Kristin
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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