+ Reply to Thread
Results 1 to 13 of 13

Help with formula looking at Date ranges?

Hybrid View

  1. #1
    Registered User
    Join Date
    12-03-2003
    Posts
    16

    Help with formula looking at Date ranges?

    I have start dates (column A) and maintenance expiry dates (column B). What I want to do is set up a formula to see if the product was renewed between 01/04/2007 - 31/03/2008 and return a simple yes, no or new_sales.

    Examples

    If the start date was 26/09/2006 and maintenance expiry date was 26/09/2008 then it would return a yes that they have renewed

    If the start date was 18/04/2006 and maintenance expiry date was 18/04/2007 then it would return a no that they have not renewed

    If the start date was 20/06/2008 and maintenance expiry date was 20/06/2009 then it would return a new_sale
    Attached Files Attached Files
    Last edited by oldchippy; 10-31-2008 at 06:49 AM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Hi,
    what is the relationship between start date, maintenance exp date and the renwal interval?

  3. #3
    Registered User
    Join Date
    12-03-2003
    Posts
    16
    Hi Arthur, renewal internval is every is 12months, relationship between start date and maintenance exp date is the date the software was purchased until it then expires.

  4. #4
    Registered User
    Join Date
    12-03-2003
    Posts
    16
    would something like this potentially work as a starting point to determine if the startdate fell into the range?

    =if(and(a1>=e1,a1<=e2,a1,"")

    assuming e1 was 01/04/2007 and e2 was 31/03/2008

    then the same thing could be repeated on the maintenance expiry column.

    If that would work, I'd just need to then do something to compare the two?

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Try
    =if(and(a1<e1,b1>e2),"yes",if((a1<e1,b1>=e1,b1<=e2),"no","new sale"))

    ( not tested, don't have XL on this PC - sorry)

  6. #6
    Registered User
    Join Date
    12-03-2003
    Posts
    16
    Quote Originally Posted by arthurbr View Post
    Try
    =if(and(a1<e1,b1>e2),"yes",if((a1<e1,b1>=e1,b1<=e2),"no","new sale"))

    ( not tested, don't have XL on this PC - sorry)
    just tried this an unfortuntely it returns #VALUE!

    any ideas/suggestions greatly appreciated as I am utterly stuck

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Missing a function, maybe AND: =IF(AND(A1<E1, B1>E2), "yes", IF(AND(A1<E1, B1>=E1, B1<=E2), "no", "new sale") )
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Quote Originally Posted by shg View Post
    Missing a function, maybe AND: =IF(AND(A1<E1, B1>E2), "yes", IF(AND(A1<E1, B1>=E1, B1<=E2), "no", "new sale") )
    Shg's formula works perfectly for me

  9. #9
    Registered User
    Join Date
    12-03-2003
    Posts
    16
    thanks for the help guys I got there in the end....here is what I used.

    =IF(AND($H2>=V$1,$H2<W$1),"New Sale",IF(AND($H2<V$1,$I2>=W$1),"Yes",IF(AND($H2<V$1,$I2<W$1),"No",IF(OR($H2>=W$1,$I2<V$1),"-","?"))))

  10. #10
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Also your dates in columns A and B are formatted as TEXT, so put number 1 a spare cell, copy it, select columns A and B, paste special > multiply, then format the cells to DATE
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  11. #11
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Does this help?
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    12-03-2003
    Posts
    16
    Quote Originally Posted by oldchippy View Post
    Hi,

    Does this help?
    thanks BUT that isn't what I want perhaps I wasn't clear, my head is at a bit tangled by it all.....

    I've attached a new sheet to show you the results I would expect to getting....columns a/b are the start/maintenance date range and columns c/d are the results I'd expect to get from the formula for the date ranges:

    01/04/06 - 31/03/07
    01/04/07 - 31/03/08

    thanks for the help so far.....
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    12-11-2008
    Location
    UK
    Posts
    1
    Hi - I have a similar issue but I don't appear to be able to post a new thread so I'm using this if that's OK.

    Basically, I want to see if a date in field B2 (e.g. 01/01/09) appears in a range of dates (e.g. C2:D30) and if it does, to return a 1, else return nothing.

    I can get this to work for specified cells but I can't get it to work for a range. The code I've used is pasted below - I can keep extending to check each row but it's going to end quite long as there are going to be up to 30 rows to check. Any ideas?

    =IF(AND(H2>=$B$2,H2<=$C$2,H2>=$B$3,H2<=$C$3,H2>=$B$4,H2<$C$4),1,0)

    Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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