View Single Post
  #16   Report Post  
Posted to microsoft.public.excel.programming
Minitman[_4_] Minitman[_4_] is offline
external usenet poster
 
Posts: 273
Default Finding The Right Row To Do A VLOOKUP

Found it.

=IF(N4<0,"",OFFSET((Daily!$P$41)*N4,2-2*ROW(A1),0)
Should be:
=IF(N4<0,"",OFFSET(Daily!$P$41,(42*N4)+2-2*ROW(A1),0)

This works for all of the entries that are in the active workbook.
The problem, however, is in the entries that are in the previous and
the next workbooks (the beginning of the first week and the back of
the last week). The If statement (N4<0,"",....) is to leave the
previous months' cells blank, I really need to populate these cells
with the data from the previous month.

Anyone have any idea as to how to find these?

Any help would be appreciated.

-Minitman


On Sun, 30 Oct 2005 23:43:55 -0600, Minitman
wrote:

Hey Tom,

I found the DAY command. But I the formula I came up with does not
seem to work. Do you see where I messed up?

=IF(N4<0,"",OFFSET((Daily!$P$41)*N4,2-2*ROW(A1),0)

N4 is the number of days(-) before (+) or after the 1st of the month.

What I am trying to do is go down to the correct cell for each day (42
times the day(N4) from P41



On Sun, 30 Oct 2005 22:50:37 -0600, Minitman
wrote:

Hey Tom,

Thanks, I can make this work.

Is there any way to use the day of the month as a parameter in this
OFFSET command?



On Sun, 30 Oct 2005 22:58:18 -0500, "Tom Ogilvy"
wrote:

Put this in a cell

=Offset($P$41,2-2*row(A1),0)

then drag down the column

the next cell down P39, the row argument would be row(A2) = 2, 2-2*2 = -2
the next cell down P37, the row agument would be row(A3) = 3, 2-2*3 = -4

and so forth.

--
Regards,
Tom Ogilvy


"Minitman" wrote in message
...
I think I understand. One question, with OFFSET how do you get it to
move up? Lets say my first location is in P41 and the next location
is in P39 and the next is in P37 and so on. How would that be
written?

-Minitman



On Sun, 30 Oct 2005 21:58:45 -0500, "Tom Ogilvy"
wrote:

If you don't know the date for the first location in Weekly (B2), then I
don't know what to tell you. If you do, then I gave you the fromula to
find
the day in daily.