Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How do I sum between any two entered values in a vlookup table

Have a table with days of the year(in sequence) in column 1 and values in
columns 2 -7 I want to enter any two dates and using a vlookup sum the data
in column two

Columns
1 2 3 4 5 6
7

1 Jan 06 24 6 5
2 Jan 06 12 8 2
3 jan 06 0 20 4
4 jan 06 20 6 5

enter 1 Jan and 4 jan the answer = 56

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default How do I sum between any two entered values in a vlookup table

One way is to use SUMPRODUCT ..

Assuming data in cols A to D from row2 down,
with real dates in col A ..

Inputs for dates will be made in F1:G1 (Enter entire dates to avoid
ambiguity):
Start date in F1, eg: 1-Jan-2006
End date in G1, eg: 4-Jan-2006

Then placed in H1:
=IF(OR(F1="",G1=""),"",SUMPRODUCT(($A$2:$A$1000=F 1)*($A$2:$A$1000<=G1),$B$2:$B$1000))

H1 returns the desired result (ie 56 per sample data posted)

As-is, H1 can be copied down to return correspondingly for other pairs of
start-end dates in cols F and G. Adapt the ranges within the SUMPRODUCT (SP)
to suit. Use the smallest range large enough to cover the max expected extent
of source data in cols A and B. Note that we can't use entire col references
in SP.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"hkaempffe" wrote:
Have a table with days of the year(in sequence) in column 1 and values in
columns 2 -7 I want to enter any two dates and using a vlookup sum the data
in column two

Columns
1 2 3 4 5 6
7

1 Jan 06 24 6 5
2 Jan 06 12 8 2
3 jan 06 0 20 4
4 jan 06 20 6 5

enter 1 Jan and 4 jan the answer = 56

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DOR DOR is offline
external usenet poster
 
Posts: 11
Default How do I sum between any two entered values in a vlookup table

With data in columns A and B, and first date in G1 and second date in
H1,

=SUM(OFFSET(B1,MATCH(G1,A:A)-1,0,MATCH(H1,A:A)-MATCH(G1,A:A)+1))

will get you want you want. You don't need a VLOOKUP.

hkaempffe wrote:
Have a table with days of the year(in sequence) in column 1 and values in
columns 2 -7 I want to enter any two dates and using a vlookup sum the data
in column two

Columns
1 2 3 4 5 6
7

1 Jan 06 24 6 5
2 Jan 06 12 8 2
3 jan 06 0 20 4
4 jan 06 20 6 5

enter 1 Jan and 4 jan the answer = 56


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DOR DOR is offline
external usenet poster
 
Posts: 11
Default How do I sum between any two entered values in a vlookup table

You may want to use Max's formula since it is more general - it does
not require the dates to be sequential, which mine does - but if the
days are always sequential, either should satisfy your needs.

DOR

hkaempffe wrote:
Have a table with days of the year(in sequence) in column 1 and values in
columns 2 -7 I want to enter any two dates and using a vlookup sum the data
in column two

Columns
1 2 3 4 5 6
7

1 Jan 06 24 6 5
2 Jan 06 12 8 2
3 jan 06 0 20 4
4 jan 06 20 6 5

enter 1 Jan and 4 jan the answer = 56


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default How do I sum between any two entered values in a vlookup table

Good point, thanks.
I failed to advertize that earlier <g
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"DOR" wrote:
You may want to use Max's formula since it is more general - it does
not require the dates to be sequential, which mine does - but if the
days are always sequential, either should satisfy your needs.

DOR



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLOOKUP stops working with pasted values SueD Excel Worksheet Functions 6 May 23rd 06 11:45 AM
Can Excel calculate populate table using row/column values & calc's on other sheet? wildswing Excel Discussion (Misc queries) 1 January 26th 06 06:18 AM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Using single cell reference as table array argument in Vlookup CornNiblet Excel Worksheet Functions 3 September 22nd 05 09:15 AM
vlookup with validation table jparker Excel Discussion (Misc queries) 3 August 12th 05 02:12 AM


All times are GMT +1. The time now is 05:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"