vlookup - day (-) 1

omypet

Board Regular
Joined
Oct 8, 2005
Messages
71
Still looking for best formula here!

My worksheet date is 01 Nov 2006, day(1)-1 is equal 0, since oct (jan, mar, may, jul, aug & dec) has 31 days.

For 01 Oct 2006 worksheet this formula works.

IF(DAY($H$1)=1,VLOOKUP(DAY($H$1)+29,$A$11:$N$44,7,0),VLOOKUP(DAY($H$1)-1,$A$11:$N$44,7,0))

The date of worksheet is behind by 1 day of the report so 01 Oct 2006 report is actually the whole whole date of Sept 1 to 30

Tks..
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hi

What are you trying to do? It appears you are trying to get the last day of the previous month - is that correct? If so, have you considered using the EOMonth() function? It is available as a formula if you install the Analysis ToolPak. To do this click menu option Tools > Add-Ins > tick 'Analysis ToolPak' > OK. Then check out the syntax for EOMonth in your help file.

HTH, Andrew
 
Upvote 0
Hello Andrew,

That's right, I am trying to get the last day of the previous month to get those data into 1st of the suceeding month. For months ending 30 it works,
another is for February, can't get the standard formula on this.

Ok thanks for the info, I will try to sort the syntax of the eomonth() function.

Cheers,
 
Upvote 0
omypet

It is still not clear to me what you are trying to do. However, this may be some use. For the date in H1, the date of the last day of the previous month is given by:
=$H$1-DAY($H$1)
and if you want the day number of this (28, 30, 31) then use
=DAY($H$1-DAY($H$1))

Have you tried Colo's HTML Maker for showing sheet samples on the board?
http://www.mrexcel.com/board2/viewtopic.php?t=92622
 
Upvote 0
Peter

Sorry for misleading, I got an idea now thanks, I can play now with this suggestions.

cheers
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,167
Members
448,554
Latest member
Gleisner2

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