+ Reply to Thread
Results 1 to 12 of 12

Multiple IF, And , OR formula with <

  1. #1
    Forum Contributor
    Join Date
    03-19-2019
    Location
    Essex, England
    MS-Off Ver
    Office 365
    Posts
    110

    Multiple IF, And , OR formula with <

    Hi thanks for looking.

    I need help with a formula which I believe should be a multiple IF, AND, OR statement but I can't get it to work, I keep getting #Value! errors or false TRUE or FALSE results. I've written the statement out below as I clearly have no clue how this formula should be structured or even if I am going about it the right way. I tried using a lookup table but that failed too, any help would be appreciated.

    If B50="Ivory Coast" and E5="Customer 1" or "Customer 2" and K50<56.00 then "Out of spec" else Blank
    If B50="Ivory Coast" and E5="Customer 3" or "Customer 4" or "Customer 5" and K50<57.50 then "Out of spec" else Blank

    Stuart

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Multiple IF, And , OR formula with <

    are these supposed to be two different formulas in two different spots or all merged together in one formula?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Contributor
    Join Date
    03-19-2019
    Location
    Essex, England
    MS-Off Ver
    Office 365
    Posts
    110

    Re: Multiple IF, And , OR formula with <

    Sorry, good point, all one formula.

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Multiple IF, And , OR formula with <

    maybe this?...
    =IF(AND(B50="ivory coast",OR(E5="customer 1",E5="customer 2"),K50<56),"out of spec",IF(AND(B50="ivory coast",OR(E5="customer 3",E5="customer 4",E5="customer 5"),K50<57.5),"out of spec",""))
    but I think that can be shortened, see if that works for you while I look at shortening it.

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Multiple IF, And , OR formula with <

    this looks like a shorter version of the same formula...
    =IF(AND(B50="ivory coast",OR(E5="customer 1",E5="customer 2"),K50<56),"out of spec",IF(AND(B50="ivory coast",OR(E5="customer 3",E5="customer 4",E5="customer 5"),K50<57.5),"out of spec",""))

  6. #6
    Forum Contributor
    Join Date
    03-19-2019
    Location
    Essex, England
    MS-Off Ver
    Office 365
    Posts
    110

    Re: Multiple IF, And , OR formula with <

    I think you have pasted the same formula again but no problem as it worked first time.

    Many thanks for the help and the speed of reply, very much appreciated.

    Stuart

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Multiple IF, And , OR formula with <

    you're right, this is what I worked on that was slightly shorter...
    =IF(OR(AND(B50="ivory coast",OR(E5="customer 1",E5="customer 2"),K50<56),OR(AND(B50="ivory coast",OR(E5="customer 3",E5="customer 4",E5="customer 5"),K50<57.5))),"out of spec","")

    Oh, and thank you for the rep!

  8. #8
    Forum Contributor
    Join Date
    03-19-2019
    Location
    Essex, England
    MS-Off Ver
    Office 365
    Posts
    110

    Re: Multiple IF, And , OR formula with <

    Even better, many thanks again, reps the least you deserve

    Stuart

  9. #9
    Forum Contributor
    Join Date
    03-19-2019
    Location
    Essex, England
    MS-Off Ver
    Office 365
    Posts
    110

    Re: Multiple IF, And , OR formula with <

    Sorry to bother you again but something I didn't mention was that B49 could be one of 2 different origins, Ivory Coast or Ghana, as I thought I could just duplicate the formula and string it together, with Ivory Coast replaced with Ghana and a different < range but it displays a blank cell or TRUE rather than 'out of spec' now, any suggestions on how to combine them?

    =IF(AND(B49="ivory coast",OR(E5="Customer 1",E5="Customer 2"),K50<56),"out of spec",IF(AND(B49="ivory coast",OR(E5="Customer 3",E5="Customer 4",E5="Customer 5"),K50<57.5),"out of spec",""))
    =IF(AND(B49="Ghana",OR(E5="Customer 1"),K50<58.5),"out of spec",IF(AND(B49="Ghana",OR(E5="Customer 2",E5="Customer 3",E5="Customer 4",E5="Customer 5"),K50<57.5),"out of spec",""))

    Stuart

  10. #10
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Multiple IF, And , OR formula with <

    The site is acting up, so I can't use less than symbols.

    I'd only interject that it'd be simpler to use a formula like

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    where that middle part in red would consider E5 and K50. No efficiency lost having multiple IF calls each returning "" if their 1st arguments evaluated FALSE. No useful purpose served testing whether B50 equals "Ivory Coast" twice.

    That said, if there were a lot of countries and a lot of customers in each country, you'd be better off using a table for K50 threshold values, with country in column 1, customer ID in column 2, and threshold values in column 3. Name that table CCTTBL, sort it in ascending order 1st on column 1 then on column 2. Formulas using this will be long, but they won't need to be edited when the table changes.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    03-19-2019
    Location
    Essex, England
    MS-Off Ver
    Office 365
    Posts
    110

    Re: Multiple IF, And , OR formula with <

    Figured it out, I just needed to remove the last "")) and = from the previous formula.

    Stuart

  12. #12
    Forum Contributor
    Join Date
    03-19-2019
    Location
    Essex, England
    MS-Off Ver
    Office 365
    Posts
    110

    Re: Multiple IF, And , OR formula with <

    Thanks hrlngrv, great suggestion and thanks for the advice on how to implement. I will go with your recommendation on the next version, this is the final piece of this particular puzzle and I'm just glad to have a working formula for now.

+ 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. [SOLVED] Retrieving multiple text strings based on multiple criteria (formula update)
    By McKneezy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-24-2019, 08:52 PM
  2. [SOLVED] Formula to count matches between multiple columns on different sheets w/ multiple criteria
    By RICK JAMES in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-05-2019, 03:28 PM
  3. [SOLVED] Formula to count occurrences, multiple ranges, multiple criteria, with wildcard
    By TMMc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-23-2017, 03:27 PM
  4. [SOLVED] Need Excel formula to use INDEX and MATCH with multiple criteria's over multiple ranges.?
    By mchilapur in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-22-2017, 08:56 AM
  5. Vlookup Formula to update multiple exchange rates for multiple products
    By jocpatch in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-24-2016, 08:36 PM
  6. Replies: 12
    Last Post: 02-10-2014, 11:59 AM
  7. Replies: 0
    Last Post: 11-08-2012, 01:07 PM

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