#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Formula Help

I need help creating a formula, please. If column a contains today() and
column b contains dates and column c contains a number, I want the formula to
look at today's date and find the date closest but not higher than today and
return the corresponding number. In this case, I want an answer of "2"
returned.
A B C
1 06/11/2009 05/15/2009 1
2 05/31/2009 2
3 06/15/2009 3

  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Formula Help

Presuming the data in cols B and C are sorted in ascending order by col B,
think you could try: =VLOOKUP(A1,B:C,2)
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"-Julie" wrote:
I need help creating a formula, please. If column a contains today() and
column b contains dates and column c contains a number, I want the formula to
look at today's date and find the date closest but not higher than today and
return the corresponding number. In this case, I want an answer of "2"
returned.
A B C
1 06/11/2009 05/15/2009 1
2 05/31/2009 2
3 06/15/2009 3

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Formula Help

Thanks, that works! But can you translate that for me? Tell me what the
formula is looking at once it gets to column B. This will help me in the
future.

"Max" wrote:

Presuming the data in cols B and C are sorted in ascending order by col B,
think you could try: =VLOOKUP(A1,B:C,2)
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"-Julie" wrote:
I need help creating a formula, please. If column a contains today() and
column b contains dates and column c contains a number, I want the formula to
look at today's date and find the date closest but not higher than today and
return the corresponding number. In this case, I want an answer of "2"
returned.
A B C
1 06/11/2009 05/15/2009 1
2 05/31/2009 2
3 06/15/2009 3

  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Formula Help

That's good. Could you spare a moment to click the YES button in that response?

The expression, with the range lookup param omitted, sets it for an approx
match to be found in col B for the lookup date in A1. This requires that the
table array be sorted in ascending order by its 1st col, ie by col B. Pl
check Excel's HELP on VLOOKUP for more details.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"-Julie" wrote:
Thanks, that works! But can you translate that for me? Tell me what the
formula is looking at once it gets to column B. This will help me in the
future.


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



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"