+ Reply to Thread
Results 1 to 8 of 8

Date Range Output.

  1. #1
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Post Date Range Output.

    Hi, I'm trying to create a formula using IF, AND, OR, however if VBA is required please advise.

    So I have 4 date ranges as below;
    01/07/10 - 30/06/11 - Year 1
    01/07/11 - 30/06/12 - Year 2
    01/07/12 - 30/06/13 - Year 3
    01/07/13 - 30/06/14 - Year 4

    If I enter in a Cell A1 '20/10/12' then Cell A2 will say "Year 3"..... and so on.

    I had a guess at this, but no luck
    =IF(AND(OR(H12>1/7/2009,H12<30/7/2010,"Year 1",OR(H12>1/7/2010,H12<30/7/2011,"Year 2",OR(H12>1/7/2011,H12<30/7/2012,"Year 3",OR(H12>1/7/2013,H12<30/7/2014,"Year 4"))))))

    Appreciate any Help.

    Alternatively If I don't have the end date, can the formula work by just using the Start Date as a triggers? So every time a date passes the threshold in moves to the next year. e.g. Year 1, Year 2.

    Many Thanks

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 365
    Posts
    2,406

    Re: Date Range Output.

    Pls find the file attach, I am givin you example with 3 formulas in your case, and just assumed about your lay out table. 2 regular formula anda 1 array formula

    cheers
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Re: Date Range Output.

    Thank you Azumi for your input and assistance.

    However I'm not totally sure that the formulas you supplied works. I put in 20th March in various years and all the formula outputs went blank? Please advise?

    Also is it possible to code the date ranges into the actual formula instead of a VLookup table?

    I have reattached our spreadsheet so you can see.

    Thank youExample-Azz.xlsx

  4. #4
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 365
    Posts
    2,406

    Re: Date Range Output.

    You have your sample workbook?, maybe date formatted could be a problem, to upload click "Go Advanced" button and find paperclip button to attach your file.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2502
    Posts
    13,700

    Re: Date Range Output.

    Quote Originally Posted by mtilbury View Post
    Thank you Azumi for your input and assistance.

    However I'm not totally sure that the formulas you supplied works. I put in 20th March in various years and all the formula outputs went blank? Please advise?

    Also is it possible to code the date ranges into the actual formula instead of a VLookup table?

    I have reattached our spreadsheet so you can see.

    Thank youAttachment 361472
    Your sample file Post #3 has dates listed as text in B1:B4 as well as A7. When I re-entered those as numeric dates on your sample workbook the formulas return values. I put another formula (array entered with Ctrl + Shift + Enter) in F8 that puts upper and lower limits on the valid date inputs in A7.

  6. #6
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Re: Date Range Output.

    LOOKUP date-range-output-example-azz & djw V2.xlsx

    Under testing these formulas are not working for me. I am testing multiply dates to test the formula and they are either coming up blank for #Value?

    I'm based in the UK. but don't think that setting would affect the formula?

    I have attached.

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Date Range Output.

    Ensure that all your dates in column A are proper Excel dates, then use this formula in B8:

    =IFERROR(VLOOKUP(A7,A1:C4,3),"")

    The formula in B13 is an array formula, so needs to be committed using the key combination of Ctrl-Shift-Enter (CSE). If you do this correctly then Excel will display curly brackets { } around the formula when viewed in the formula bar, though you do not type these yourself.

    Hope this helps.

    Pete

  8. #8
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Re: Date Range Output.

    Thank you - It works

    Appreciate everyones input.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] need help to lookup a (workday) date, and then excel output to show that date minus 1
    By Marijke in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-23-2013, 11:13 AM
  2. Output date from changing cell range
    By kolonel in forum Excel General
    Replies: 6
    Last Post: 08-08-2012, 11:43 PM
  3. Excel 2007 : Formula To Output What Range A Date Is In
    By The_Snook in forum Excel General
    Replies: 2
    Last Post: 01-07-2012, 06:27 PM
  4. Output Customer Name for a specific date range
    By mdobmeier in forum Excel General
    Replies: 5
    Last Post: 04-29-2011, 04:36 PM
  5. Replies: 8
    Last Post: 02-27-2009, 06:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1