Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using Date Ranges

I have a table of information in Excel. One of the columns is a date.
I would like to automatcally return a value if the date falls within
certain ranges. For example, if the date is between 1/1/01 and
5/31/01 then return "A." But if the date is between 6/1/01 and
5/31/02 then return "B." The problem I have is that the date ranges
cross years and are not always 365 days. I have done this using
formulas, but with 8 ranges, I have a nested IF statement with 7 If's.
Any suggestions using VBA?

If anyone wants more info, just let me know.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Using Date Ranges

Hi

Something like
=CHOOSE(MATCH(A1,{38352,38168,37986,37802,37621,37 437,37256,37072,36891},-1)
,"A","B","C","D","E","F","G","H")

where A1 contains date, and 5-digit numbers in MATCH array represent dates
in descending order (in my example they are 31.12.2004, 30.06.2004,
31.12.2003, ..., 31.12.2000). Of course the number of matches isn't
infinite, but 29 is considerable better as 7.


--
Arvi Laanemets
(Don't use my reply address - it's spam-trap)


"tchillie" wrote in message
om...
I have a table of information in Excel. One of the columns is a date.
I would like to automatcally return a value if the date falls within
certain ranges. For example, if the date is between 1/1/01 and
5/31/01 then return "A." But if the date is between 6/1/01 and
5/31/02 then return "B." The problem I have is that the date ranges
cross years and are not always 365 days. I have done this using
formulas, but with 8 ranges, I have a nested IF statement with 7 If's.
Any suggestions using VBA?

If anyone wants more info, just let me know.



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
SUM and IF using two date ranges TomR Excel Discussion (Misc queries) 2 January 3rd 10 04:36 PM
How do I get a new calculated date from different date ranges? Ann LeBlanc Excel Worksheet Functions 3 June 26th 09 01:56 PM
Date Ranges Liz J[_2_] Excel Discussion (Misc queries) 2 January 16th 09 03:54 AM
compare date to various date ranges and sum value al Excel Worksheet Functions 2 January 10th 07 10:17 AM
sum of date ranges Tanya Excel Worksheet Functions 1 January 4th 05 04:11 AM


All times are GMT +1. The time now is 11: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"