+ Reply to Thread
Results 1 to 7 of 7

Multiple Embedded IF & AND formula - not giving the expected result

  1. #1
    Registered User
    Join Date
    02-04-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    41

    Multiple Embedded IF & AND formula - not giving the expected result

    Hi all,

    I have a formula as shown below,

    Please Login or Register  to view this content.
    ReqTyp & BusGrp are named ranges.

    The expected result is if ReqTyp = New Customer, BusGrp = AESE and Cell E50 = GB, is to return "EU12 - SEBV Domestic Customers" / Expected result if E50 <> GB is ""EU11 - SEBV Foreign Customer".

    When I test the following separately, it returns the expected result,
    Please Login or Register  to view this content.
    but when on the end of the full formula, it is returning "FALSE", I get the following error - and I cannot for the life of me figure out where the issue is.

    IFAND.JPG

    Any guidance or help here would be appreciated. Even if it is a suggestion on how to improve it!

    Thank you.
    Chris

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Multiple Embedded IF & AND formula - not giving the expected result

    No idea if it does what you want, but this corrects the syntax

    =IF($E$12="Intercompany","Intercompany",
    IF(AND(ReqTyp="New Ship-to/ZN Partners",BusGrp="AESE"),"EU30 - SEBV Ship-to",
    IF(AND(ReqTyp="New Payer",BusGrp="AESE"),"EU13 - SEBV Payer",
    IF(AND(ReqTyp="New Bill-to",BusGrp="AESE"),"EU14 - SEBV Bill-to",
    IF(AND(ReqTyp="Amend existing Ship-to",BusGrp="AESE"),"EU30 - SEBV Ship-to",
    IF(AND(ReqTyp="Amend existing Bill-to",BusGrp="AESE"),"EU14 - SEBV Bill-to",
    IF(AND(ReqTyp="Amend existing Payer",BusGrp="AESE"),"EU13 - SEBV Payer",
    IF(AND(ReqTyp="Amend Existing Sold-to",BusGrp="AESE"),
    IF(AND(ReqTyp="New Customer",BusGrp="AESE",$E$50="GB"),"EU12 - SEBV DOMESTIC CUSTOMERS",
    IF(AND(ReqTyp="New Customer",BusGrp="AESE",$E$50<>"GB"),"EU11 - SEBV Foreign Customer"))))))))))

  3. #3
    Registered User
    Join Date
    02-04-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    41

    Re: Multiple Embedded IF & AND formula - not giving the expected result

    Hi Bob, thank you for your reply.
    I have looked through your suggestion but couldn't find the syntax error in my formula.

    Tried your version and I am still getting FALSE returned when ReqTyp = "New Customer". So I am going to rethink how to go about what I need.

    Thanks anyway. I will close this post.

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Multiple Embedded IF & AND formula - not giving the expected result

    You will be getting a false as none of the if statements are true. Any typos or trailing spaces for example will mean that the match does not happen. if you attach an example people will solve this for you, but Bob's Formula works. I suspect the text does not match the text in your workbook

  5. #5
    Registered User
    Join Date
    02-04-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    41

    Re: Multiple Embedded IF & AND formula - not giving the expected result

    Thanks davsth, i have inherited this formula from a previous colleague and am trying to get it to work with new criteria the company wants to use. I am now rewriting the formula from scratch, using the correction Bob provided.

    I didn't mean to imply that his suggestion was not correct (Apologies if it came across that way!!)

  6. #6
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Multiple Embedded IF & AND formula - not giving the expected result

    I just wanted to say don't give up! People will still try to help you reach a solution. Usually if the values are completed from data validation (drop down lists) this reduces the potential for error in typing and so formulas work more reliably

  7. #7
    Registered User
    Join Date
    02-04-2019
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    41

    Re: Multiple Embedded IF & AND formula - not giving the expected result

    No worries and I haven't given up - just restructured the formula a little bit, as the issue seemed to be with the last IF's, so started from scratch and used:

    Please Login or Register  to view this content.
    now working properly.... lesson here is that sometimes it is easier to start from scratch than to try and amend an existing formula
    Last edited by ChrisMP; 09-23-2019 at 05:11 AM.

+ 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] Formula not giving expected results
    By billfinnjr in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-28-2019, 02:26 PM
  2. [SOLVED] RIGHT Formula not giving expected results
    By billfinnjr in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-28-2018, 09:13 AM
  3. [SOLVED] Formula not giving expected results
    By billfinnjr in forum Excel General
    Replies: 7
    Last Post: 08-15-2018, 09:58 AM
  4. [SOLVED] Index - Match formula not giving me an expected result
    By longbow007 in forum Excel General
    Replies: 5
    Last Post: 11-25-2015, 07:34 PM
  5. [SOLVED] Future Date - TODAY() : not giving expected result
    By Psycho_uk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-08-2013, 04:37 AM
  6. OR Operator Line Not Giving Expected Result
    By Gos-C in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-22-2010, 06:14 AM
  7. IF Formula not giving expected results.
    By fungus in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-17-2010, 02:10 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