• 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 statement with a TRUE / FALSE condition

gregorii77

New Member
Given the table, I have the following criteria (times in 24 hour):

IF 6:00 to 10:00 AND weekday = Y THEN Category = 1
IF 10:01 to 16:00 AND weekday = Y THEN Category = 2
IF 16:01 to 20:00 AND weekday = Y THEN Category = 3

IF 06:00 to 20:00 AND weekday = N THEN Category = 4

There are no times before 06:00 or after 20:00. I am trying to contrive the formula for use in F2. Uploaded file included.

My efforts have been met with disastrous results. Any assistance you could provide would be fantastic and greatly appreciated! Thank you so much!
 

Attachments

  • Chandoo_IFQuest.xlsx
    8.4 KB · Views: 5
Worked like a charm! For my own personal edification, how is it using the MEDIAN function? I know what the median is but could you explain it's purpose here? Much appreciated!!!!!!!!!!!!!! G
 
Basically Median is used to check that values in D2 falls between 2 times.
Where TIME(hour,minutes,seconds).

If Median return D2 value, then it is between those 2 times.

You only need to check for first 2 time ranges, then check for E2="N". If all of those conditions are not met, then value must default to Category 3.
 
Back
Top