Nested if statements on Dates

  • Hi All-


    I would like to have assistance in writing an equation which will look at several criteria and spit out if a date is between 2 given dates. Basically if it is in Batch 1 then the equation will check a date and see if it falls on our between 1/7/2013 - 1/18/2013 and returns true/false and if it is in batch 2 it does it for the corresponding dates etc.


    Any thoughts on how to do this easily?



    [TABLE="width: 210"]

    [tr]


    [td]

    Batch

    [/td]


    [td]

    Start Date

    [/td]


    [td]

    End Date

    [/td]


    [/tr]


    [tr]


    [td]

    1

    [/td]


    [TD="align: right"]2013-01-07[/TD]
    [TD="align: right"]2013-01-18[/TD]

    [/tr]


    [tr]


    [td]

    2

    [/td]


    [TD="align: right"]2013-01-21[/TD]
    [TD="align: right"]2013-02-01[/TD]

    [/tr]


    [tr]


    [td]

    3

    [/td]


    [TD="align: right"]2013-02-04[/TD]
    [TD="align: right"]2013-02-15[/TD]

    [/tr]


    [tr]


    [td]

    4

    [/td]


    [TD="align: right"]2013-02-18[/TD]
    [TD="align: right"]2013-03-01[/TD]

    [/tr]


    [tr]


    [td]

    5

    [/td]


    [TD="align: right"]2013-03-04[/TD]
    [TD="align: right"]2013-03-15[/TD]

    [/tr]


    [tr]


    [td]

    6

    [/td]


    [TD="align: right"]2013-03-18[/TD]
    [TD="align: right"]2013-03-29[/TD]

    [/tr]


    [/TABLE]

  • Re: Nested if statements on Dates


    asumming the table is in columns A-C
    =SUMPRODUCT(--(A2:A10=G2),--(B2:B10<=H2),--(C2:C10>=H2))


    the batch is in G2 and the Date is in H2
    thes above will return a 1 if the the date is in the range for that batch number


    if you want true or false
    =IF(SUMPRODUCT(--(A2:A10=G2),--(B2:B10<=H2),--(C2:C10>=H2))=1,TRUE,FALSE)


    see attached

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!