+ Reply to Thread
Results 1 to 4 of 4

if statement with condition

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,233

    if statement with condition

    hello all....

    i'm currently experiencing some problems with my if statements

    basically i have 4 scenarios in there...im just not sure if my logic is correct or if im missing something....the formula is as follows:

    =IF(O12<0,"",IF(O12>0.1<4.3333,'Lookup Up'!$T$2,IF(O12>4.3334<8.3333,'Lookup Up'!$T$3,IF(O12>8.3334<12.9999,'Lookup Up'!$T$4,BB$9))))

    im asking the formula for the following....
    O is # of weeks a person has worked in total
    ...so basically
    -scenario #1 is saying....if they have worked b/w 0.1-4.3333 weeks, then lookup value in sheet "lookup" (which is $75)

    -scenario #2 is saying....if they worked b/w 4.3334-8.3333 weeks, then lookup value in sheet "lookup" (which is $100)

    -scenario #3 is saying...if they worked b/w 8.3334-12.9999 weeks, then lookup value in sheet "lookup" (which is $150)

    - if none of those scenarios are true (if person has worked greater than 13 weeks, then make the value = $200 (BB$9 - reference)


    ...now when i do this, it gives me $200, its not for some reason its not applying the logic in scenario #1, 2 or 3.........hope you guys follow and can help, pls and thxs
    Last edited by Paul; 11-27-2010 at 12:26 AM. Reason: Removed e-mail address to prevent spam

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: if statement with condition

    When doing "greater than A and less than B" comparisons, you have to use AND, e.g.

    =IF(AND(O12>0,O12<0.3333),do_this,do_that)

    In your case, a LOOKUP function may be simpler. For example:

    =IF(O12<=0,"",LOOKUP(O12,{0.1,4.3334,8.3334,13},{75,100,150,200}))

  3. #3
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,233

    Re: if statement with condition

    hey paul

    thx u very much, that is great and alot simpler...definitely a great learnign experience.....

    quick question...
    the "75,100,150" are preferred to be referenced from driver cells, incase we change these values in teh future...and their values are on a seperate sheet called "LOOKUP" - no relevance to vlookup or anything of that nature......i tried to add it in myself but it didnt work....your thoughts?

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: if statement with condition

    Maybe try:

    =IF(O12<=0,"",IF(O12>=13,BB$9,LOOKUP(O12,{0.1,4.3334,8.3334},'Lookup Up'!$T$2:$T$4)))

+ 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