+ Reply to Thread
Results 1 to 3 of 3

If formula to test several conditions

  1. #1
    MIchel Khennafi
    Guest

    If formula to test several conditions

    Good evening Excel Gurus

    In a situation where I want to determine the number of vacation days an
    employees would have...

    In A1 I have the hire date
    In B1 I want to determine the number of days of vacation the person may have
    using the following conditions:
    - From 0 to 6 months --> 0 Days
    - From 6 months to less than 1 --> 5 days
    - From 1 to Less than 5 --> 10 days
    - From 5 to less than 12 --> 5 days
    - From 12 to 20 --> 20 days

    This situation is a challenge because in the cell B1
    - I need to determine the number of year/months/days based on today's date
    compared to the HIRE DATE in A1
    - I need to have several "if" condition tested at the same time

    Can someone help?

    Thanks so much




  2. #2
    Bob Phillips
    Guest

    Re: If formula to test several conditions

    Create a table like so

    ............... I..............J............K
    1.............20...........20............0
    2.............15...........12............0
    3.............10.............5............0
    4................5............1............0
    5...............0.............0............6

    then in H1 add and copy down to H5.

    In B1, use =VLOOKUP(A1,$H$1:$I$5,2)

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "MIchel Khennafi" <michel.khennafi@mac.com> wrote in message
    news:uEoKdfWbGHA.1208@TK2MSFTNGP02.phx.gbl...
    > Good evening Excel Gurus
    >
    > In a situation where I want to determine the number of vacation days an
    > employees would have...
    >
    > In A1 I have the hire date
    > In B1 I want to determine the number of days of vacation the person may

    have
    > using the following conditions:
    > - From 0 to 6 months --> 0 Days
    > - From 6 months to less than 1 --> 5 days
    > - From 1 to Less than 5 --> 10 days
    > - From 5 to less than 12 --> 5 days
    > - From 12 to 20 --> 20 days
    >
    > This situation is a challenge because in the cell B1
    > - I need to determine the number of year/months/days based on today's date
    > compared to the HIRE DATE in A1
    > - I need to have several "if" condition tested at the same time
    >
    > Can someone help?
    >
    > Thanks so much
    >
    >
    >




  3. #3
    pdberger
    Guest

    RE: If formula to test several conditions

    Michel --

    Here's one approach:

    =IF(TODAY()-A1<182,0,IF(TODAY()-A1<365,5,IF(TODAY()-A1<1825,10)))

    Basically, you create a set of "nested" if-statements in which you put the
    next if-condition into the false part of the previous if statement. I didn't
    do the last two parts, mainly out of laziness but also so you could practice
    it out on your own.

    HTH

    "MIchel Khennafi" wrote:

    > Good evening Excel Gurus
    >
    > In a situation where I want to determine the number of vacation days an
    > employees would have...
    >
    > In A1 I have the hire date
    > In B1 I want to determine the number of days of vacation the person may have
    > using the following conditions:
    > - From 0 to 6 months --> 0 Days
    > - From 6 months to less than 1 --> 5 days
    > - From 1 to Less than 5 --> 10 days
    > - From 5 to less than 12 --> 5 days
    > - From 12 to 20 --> 20 days
    >
    > This situation is a challenge because in the cell B1
    > - I need to determine the number of year/months/days based on today's date
    > compared to the HIRE DATE in A1
    > - I need to have several "if" condition tested at the same time
    >
    > Can someone help?
    >
    > Thanks so much
    >
    >
    >
    >


+ 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