Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional SUM of column values depending on the heading (month) | Excel Discussion (Misc queries) | |||
How do I sort between worksheets depending on variable | Excel Worksheet Functions | |||
How do I add totals from a range of dates depending on the month? | Excel Worksheet Functions | |||
Display number of day of month depending on the year | Excel Discussion (Misc queries) | |||
Reading Data from another workbook... depending on variable in a cell? | Excel Discussion (Misc queries) |