ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Date calculation and possible vlookup (https://www.excelbanter.com/excel-worksheet-functions/153378-date-calculation-possible-vlookup.html)

Sarah (OGI)

Date calculation and possible vlookup
 
In cell C2 I have a date (in a dd/mm/yyyy format).

In cell H2 of the same worksheet, I would like to:
a) find out how many months difference there is between the date in C2 and
31 May 2007.
b) take the result of the above calculation and find that number in column A
of another worksheet and pull out the corresponding value in column B.

Any ideas?

Mike H

Date calculation and possible vlookup
 
Hi,

Try this

=VLOOKUP(DATEDIF(C2,C3,"m"),Sheet2!A1:B16,2,FALSE)

I have put 31/5/2007 in C3 instead of in the formula and assumed C2 is
earlier than C3

Mike

"Sarah (OGI)" wrote:

In cell C2 I have a date (in a dd/mm/yyyy format).

In cell H2 of the same worksheet, I would like to:
a) find out how many months difference there is between the date in C2 and
31 May 2007.
b) take the result of the above calculation and find that number in column A
of another worksheet and pull out the corresponding value in column B.

Any ideas?



All times are GMT +1. The time now is 11:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com