+ Reply to Thread
Results 1 to 11 of 11

Need the correct formula for an IF statement...

  1. #1
    Forum Contributor
    Join Date
    09-08-2016
    Location
    Canada
    MS-Off Ver
    MS365 Version 2401
    Posts
    130

    Need the correct formula for an IF statement...

    Hi All,

    Need help on writing a formula that has me stumped.

    Below is an image of the excel document.

    Here is the formula that I am currently using that works for the Threshold Vacancy but as I mention below, it needs to incorporate both logic in the one formula.

    =IF(D2<B1,"YES","NO")

    I need my formula to point to the City Vacancy if I decide to not use the threshold vacancy. So if threshold vacancy is blank, then point to City Vacancy and tell me if the threshold is met (YES/NO). So I need a formula to incorporate both B1 & B2.

    So, for more clarity on the logic....

    If B1 is populated then return YES or NO if D2 is less than B1 and if B1 is blank then look at B2 and tell me if D2 is less than B2 and return a YES or NO.

    Hope I am making sense in the logic of what I am trying to achieve.

    Thanks for the help as I have been stuck on this.

    Regards.
    Attached Images Attached Images
    Last edited by jeptik; 10-07-2016 at 01:26 PM.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Nested IF Statements? or IFTHEN statement?....Not sure...

    Thread title updated, change request removed.
    Last edited by jason.b75; 10-07-2016 at 01:31 PM.

  3. #3
    Forum Contributor
    Join Date
    09-08-2016
    Location
    Canada
    MS-Off Ver
    MS365 Version 2401
    Posts
    130

    Re: Nested IF Statements? or IFTHEN statement?....Not sure...

    Thank you for pointing that out to me Jason.

    jeptik

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Need the correct formula for an IF statement...

    Thanks for editing your title!

    See if this works.

    =IF(D1< LOOKUP(1,B1:B2),"YES","NO")

  5. #5
    Forum Contributor
    Join Date
    09-08-2016
    Location
    Canada
    MS-Off Ver
    MS365 Version 2401
    Posts
    130

    Re: Need the correct formula for an IF statement...

    Hi jason.b75,

    Thank you very much for your suggestion!

    It works like a charm.

    Now if I decide to add another row under City Vacancy with another value for Region Vacancy, would I just have to extend my formula to include B3 in this case?

    Thanks.

  6. #6
    Forum Contributor
    Join Date
    09-08-2016
    Location
    Canada
    MS-Off Ver
    MS365 Version 2401
    Posts
    130

    Re: Need the correct formula for an IF statement...

    Hi jason.b75,

    Thank you very much for your suggestion!

    It works like a charm.

    Now if I decide to add another row under City Vacancy with another value for Region Vacancy, would I just have to extend my formula to include B3 in this case?

    Thanks.

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Need the correct formula for an IF statement...

    It depends on order of priority, you could do it that way, for example

    =IF(D1< LOOKUP(1,B1:B3),"YES","NO")

    using this method will always take the last value in the list, so if all 3 cells have a %age figure, B3 will be used and the others ignored.

  8. #8
    Forum Contributor
    Join Date
    09-08-2016
    Location
    Canada
    MS-Off Ver
    MS365 Version 2401
    Posts
    130

    Re: Need the correct formula for an IF statement...

    Hmmm...

    Now you have me thinking....is there a way to prioritize which % it looks at first? So, can I tell the formula to look at B1 first and if not available, then B2 and if not available then B3?

    Thanks.

  9. #9
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,253

    Re: Need the correct formula for an IF statement...

    Try this ...

    =IF(D1< INDEX($B$2:$B$6,MATCH(TRUE,$B$2:$B$6<>"",0)),"YES","NO")

    Array formula, enter with Ctrl+Shift+Enter.

  10. #10
    Forum Contributor
    Join Date
    09-08-2016
    Location
    Canada
    MS-Off Ver
    MS365 Version 2401
    Posts
    130

    Re: Need the correct formula for an IF statement...

    Thanks Phuocam!!

    Worked perfectly!

  11. #11
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,253

    Re: Need the correct formula for an IF statement...

    You are welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Nested IF statement error. Nested True statement is not triggering
    By Lucas7040 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-26-2016, 11:41 AM
  2. [SOLVED] Help with nested IfThen Macro
    By jschoeb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-12-2015, 03:58 PM
  3. IFTHEN Statement - checking if a number is larger by a certain % - noob question
    By wallstreetballa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-06-2013, 02:22 AM
  4. [SOLVED] Combine two IF And statements in a single nested IF statement
    By iohalloran in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-03-2012, 02:59 PM
  5. Replies: 1
    Last Post: 06-29-2012, 03:27 PM
  6. [SOLVED] IFTHEN Statements and Dates
    By Rapacious in forum Excel General
    Replies: 6
    Last Post: 04-10-2012, 07:06 PM
  7. Replies: 12
    Last Post: 05-15-2009, 08:38 AM

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