• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

If condition

I have an excel sheet where difference between two dates is given in tenure column. Now I want to make a slab that if somebody has worked for less than 1 year it will be zero. If somebody worked for 2 years he will 1-2 years slab. If somebody worked for 3 Years he will be in 2-3 years slab. and if he has worked for more than 3 years he will be in >3 years slab. Please help .
 

Attachments

  • Book2.xlsx
    9.6 KB · Views: 10
Arup Dutta Chowdhury, Good afternoon.

Try to use:

E2 --> =IF(--LEFT(D2;1)>3;">3 years";IF(--LEFT(D2;1)=3;"2-3 years";IF(--LEFT(D2;1)>=1;"1-2 years";0)))

Please, tell us if it worked as you desire.

I hope it helps.
 

Attachments

  • 08-06-2021_chandoo_Book2.xlsx
    10.3 KB · Views: 5
Using Excel 365, columns C and D could read
Code:
= DATEDIF(joined, left,"y")  & "Year" &
  DATEDIF(joined, left,"ym") & "Months"
 
and

= SWITCH(
    DATEDIF(joined,left,"y"),
    0, "zero",
    1, "1-2 years",
    2, "2-3 years",
       ">3 years" )
 
Back
Top