Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Please help - subtotal using vlookup depending on variable month

Hi All,
I'm trying to find a value from table A in table B using vlookup and then
sum the months YTD depending on the month. So for example if I enter April
or 4
table A
Month__4___<---value entered manually
name $ytd
bob 142
mob 117
gob 152

table b
PC Jan Feb Mar Apr May Jun Jul..........Dec
bob 22 50 45 25 56 78 89 12
mob 32 25 25 35 52 85 24 15
gob 32 20 15 85 95 65 45 85

Many thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Please help - subtotal using vlookup depending on variable month

Maybe something like:

=SUMIF(Sheet2!A:A,"bob",
INDEX(Sheet2!A:M,,MATCH(TEXT(DATE(2008,$A$1,1),"mm m"),Sheet2!$A$1:$M$1,0)))

You can replace "bob" with the cell that contains that text (like $a2):

=SUMIF(Sheet2!A:A,$A2,
INDEX(Sheet2!$A:$M,,MATCH(TEXT(DATE(2008,$A$1,1)," mmm"),Sheet2!$A$1:$M$1,0)))

This assumes that the table b is on Sheet2 in columns A:M and the month number
is in A1 of the sheet with the formula.



robstton wrote:

Hi All,
I'm trying to find a value from table A in table B using vlookup and then
sum the months YTD depending on the month. So for example if I enter April
or 4
table A
Month__4___<---value entered manually
name $ytd
bob 142
mob 117
gob 152

table b
PC Jan Feb Mar Apr May Jun Jul..........Dec
bob 22 50 45 25 56 78 89 12
mob 32 25 25 35 52 85 24 15
gob 32 20 15 85 95 65 45 85

Many thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 915
Default Please help - subtotal using vlookup depending on variable month

robstton wrote:
Hi All,
I'm trying to find a value from table A in table B using vlookup and then
sum the months YTD depending on the month. So for example if I enter April
or 4
table A
Month__4___<---value entered manually
name $ytd
bob 142
mob 117
gob 152

table b
PC Jan Feb Mar Apr May Jun Jul..........Dec
bob 22 50 45 25 56 78 89 12
mob 32 25 25 35 52 85 24 15
gob 32 20 15 85 95 65 45 85

Many thanks


One way... This will work as long as you are using month numbers in
TABLEA (not names or abbreviations). How you label the months in TABLEB
doesn't matter so much as long as they start with January and are
chronological and continuous.

First I set up TABLEB somewhere as a named range -- this helps make the
solution more universal.

Then I set up TABLEA in A1:B5, where B1 has the month number to look up
and the names are in A3:A5.

=SUM(OFFSET(TABLEB,MATCH(A3,OFFSET(TABLEB,0,0,999, 1),0)-1,1,1,$B$1))

The "999" in this formula just need to be large enough to accommodate
the number of rows in TABLEB.
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
Conditional SUM of column values depending on the heading (month) Pat Rob Excel Discussion (Misc queries) 1 November 12th 08 05:37 PM
How do I sort between worksheets depending on variable Miriaham Excel Worksheet Functions 1 September 30th 08 11:34 PM
How do I add totals from a range of dates depending on the month? confused Excel Worksheet Functions 3 September 12th 06 02:53 AM
Display number of day of month depending on the year Dn_ Excel Discussion (Misc queries) 1 May 24th 06 05:36 PM
Reading Data from another workbook... depending on variable in a cell? Rob Moyle Excel Discussion (Misc queries) 4 March 13th 06 04:21 PM


All times are GMT +1. The time now is 04:06 AM.

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"