Vlookup & sum

Drewmyster

Board Regular
Joined
May 16, 2007
Messages
151
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I'm trying to do the following;

Lookup a range of cells that match a date and then produce the total sum of these cells as opposed to the first one that is located.

Please advise.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Not sure when the SumIfs() formula was introduced, but...
Excel Workbook
ABCDEFGH
1PeriodWeekTotalProofPeriod3/1/2011<< Input
21/31/2011310SUM272
31/31/2011315
41/31/201132045
52/5/2011345
62/5/201132772
73/1/2011398
83/1/2011352
93/1/2011378
103/1/2011322
113/1/2011322272
Sheet1
Excel 2007
Cell Formulas
RangeFormula
G2=SUMIFS(C:C,A:A,G1)
D4=SUM(C2:C4)
D6=C6+C5
D11=SUM(C7:C11)
 
Upvote 0
Thanks but I still can't get that formula to work for what I'm trying to do.

Date range is Cell A1 on a "Totals" sheet
Total range is in Sheet1 and Sheet1 has both a date column and total column to look up against. There are multiple totals to add in rows C:C.
I want the formula to add the sum of all date matches.

Please advise.

Thanks
 
Upvote 0
Thanks but I still can't get that formula to work for what I'm trying to do.

Date range is Cell A1 on a "Totals" sheet
Total range is in Sheet1 and Sheet1 has both a date column and total column to look up against. There are multiple totals to add in rows C:C.
I want the formula to add the sum of all date matches.

Please advise.

Thanks

Anyone else able to help with this?
Your explanation is not very clear.

Try expressing your question something like this...

I want to sum values in the range C2:C100 if the date in the range A2:A100 = 1/1/2011.

It would be just about impossible to not understand that! ;)
 
Upvote 0
I want to find the sum total of all cells that are in the date range of 25/05/2011 and that match cell B3's date (which I can change when I wish to).

I also want to count how many occurances of 25/05/2011 there are in that date range (A3:A650).

So far I've used VLOOKUP to do this, but it only returns the first known result in ascending order, but what I want is to get the sum total of all known results for that date range.

I hope this helps.
 
Upvote 0
I want to find the sum total of all cells that are in the date range of 25/05/2011 and that match cell B3's date (which I can change when I wish to).

I also want to count how many occurances of 25/05/2011 there are in that date range (A3:A650).

So far I've used VLOOKUP to do this, but it only returns the first known result in ascending order, but what I want is to get the sum total of all known results for that date range.

I hope this helps.
OK, so the dates are in the range A3:A650. What is the range to sum?

Try this...

=SUMIF(A3:A650,B3,range_to_sum)

Replace "range_to_sum" with the actual range address.

To get the count of dates:

=COUNTIF(A3:A650,B3)
 
Upvote 0
Thanks T. Valko, that really helps alot thanks.

Just a spin-off question about the COUNTIF formula;

How can I use this formula to search for a text string against the date?

I've used this formula =COUNTIF('TEST'!A:J,"Enabled") to count the number of occurances of the word "Enabled" but if I ask it to look against the date in B3 it returns errors.

Please can you advise?
 
Upvote 0
Thanks T. Valko, that really helps alot thanks.

Just a spin-off question about the COUNTIF formula;

How can I use this formula to search for a text string against the date?

I've used this formula =COUNTIF('TEST'!A:J,"Enabled") to count the number of occurances of the word "Enabled" but if I ask it to look against the date in B3 it returns errors.

Please can you advise?
Try something like this...

=SUMPRODUCT((date_range=B3)*(text_range="Enabled"))

Note that with SUMPRODUCT you *can't* use entire columns as range references unless you're using Excel 2007 or later. And, even if you are using Excel 2007 or later, you should avoid using entire columns as range references with SUMPRODUCT.
 
Upvote 0
The SUMPRODUCT formula doesn't seem to be working for me, I get an error message each time that says;

"Excel ran out of resources while attempting to calculate one or more formulas. As a result, these formulas cannot be evaluated."

Please advise?
 
Upvote 0

Forum statistics

Threads
1,224,552
Messages
6,179,484
Members
452,917
Latest member
MrsMSalt

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