+ Reply to Thread
Results 1 to 10 of 10

If function nested with AND

Hybrid View

  1. #1
    Registered User
    Join Date
    04-08-2014
    Location
    York
    MS-Off Ver
    Excel 2013
    Posts
    24

    If function nested with AND

    hI,

    This is a basic one but for some reason is not working and I can't see any fundamental errors on it.

    The below works fine.....a long list of ifs actually;
    =IF(AND(K7="",O7=""),"",IF(AND(K7<>"",O7=""),"Needs Pricing",IF(AND(K7="",O7<>""),"Needs Quote",IF(AND(K7="",O7=""),"NoQuote NoPrice",IF(AND(K7<>"",O7<>""),"Quoted&Priced",IF(COUNTIF(B7,"*CANCELLED*"),"CANCELLED",IF(COUNTIF(B7,"*duplicate*")+COUNTIF(AG7,"*duplicated*"),"DUPLICATE")))))))

    However the below doesn't and can't understand why since I just added one more IF(AND) function.

    It's basically the same as above nested formula and only thing that I've done is to add IF(AND(O7<>"",L7<>"),"PO&Quoted&Priced"). Any ideas why it wouldn't work?;
    =IF(AND(K7="",O7=""),"",IF(AND(K7<>"",O7=""),"Needs Pricing",IF(AND(K7="",O7<>""),"Needs Quote",IF(AND(K7="",O7=""),"NoQuote NoPrice",IF(AND(K7<>"",O7<>"",L7<>"),"PO&Quoted&Priced",IF(COUNTIF(B7,"*CANCELLED*"),"CANCELLED",IF(COUNTIF(B7,"*duplicate*")+COUNTIF(AG7,"*duplicated*"),"DUPLICATE")))))))

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,100

    Re: If function nested with AND

    you have
    IF(AND(K7="",O7=""),""
    and again here
    IF(AND(K7="",O7=""),"NoQuote NoPrice"

    what are you trying to do here
    IF(AND(O7<>"",L7<>"),"PO&Quoted&Priced").
    concatenate the Purchase Order and Price
    this will just give you the TEXT
    "PO&Quoted&Priced"
    if you want the cells with the info in - assume PO in A2 and Quoted in B2 and Priced in C2
    =A2&B2&C2
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    04-08-2014
    Location
    York
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: If function nested with AND

    Thanks for quick reply. The ampersand is just to indicate that it has a PO and it has been quoted and priced

  4. #4
    Registered User
    Join Date
    04-08-2014
    Location
    York
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: If function nested with AND

    Well, that was embarrassing now. Many thanks it works perfect now as it should

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,082

    Re: If function nested with AND

    You are missing a double quote:

    Formula: copy to clipboard

    =IF(AND(K7="",O7=""),"",
    IF(AND(K7<>"",O7=""),"Needs Pricing",
    IF(AND(K7="",O7<>""),"Needs Quote",
    IF(AND(K7="",O7=""),"NoQuote NoPrice",
    IF(AND(K7<>"",O7<>"",L7<>""),"PO&Quoted&Priced",
    IF(COUNTIF(B7,"*CANCELLED*"),"CANCELLED",
    IF(COUNTIF(B7,"*duplicate*")+COUNTIF(AG7,"*duplicated*"),"DUPLICATE")))))))
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,082

    Re: If function nested with AND

    Note, the formula will never get as far as this:
    Formula: copy to clipboard
     IF(AND(K7="",O7=""),"NoQuote NoPrice",
    because you start with
    Formula: copy to clipboard
    =IF(AND(K7="",O7=""),"",

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,082

    Re: If function nested with AND

    Also:

    Formula: copy to clipboard

    =IF(AND(K7="",O7=""),"",
    IF(AND(K7<>"",O7=""),"Needs Pricing",
    IF(AND(K7="",O7<>""),"Needs Quote",
    IF(AND(K7="",O7=""),"NoQuote NoPrice",
    IF(AND(K7<>"",O7<>"",L7<>""),"PO&Quoted&Priced",
    IF(COUNTIF(B7,"*CANCELLED*"),"CANCELLED",
    IF(COUNTIF(B7,"*duplicate*")+COUNTIF(AG7,"*duplicated*"),"DUPLICATE","what goes here?")))))))

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,100

    Re: If function nested with AND

    Edit - TMS also covered the false as i was typing
    Thanks for quick reply. The ampersand is just to indicate that it has a PO and it has been quoted and priced
    OK,
    BUT you do have the same AND() further in the Nested IF as pointed out by me and TMS , also the missing ""
    and a final FALSE condition after the DUPLICATED , so you would get FALSE in the cell if no matches at all

  9. #9
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,100

    Re: If function nested with AND

    nothing to be embarrassed about, when working coding, often the simple things took longer to find and on a few occasions had to ask only to find i missed a . or ; in a code string
    glad its now sorted for you

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,082

    Re: If function nested with AND

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Excel function: countifs with nested OR function and wildcards
    By Franfv in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-18-2020, 03:57 AM
  2. Replies: 2
    Last Post: 01-05-2019, 03:33 AM
  3. [SOLVED] Nested vlookup or nested IFAND function?
    By jeptik in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-11-2017, 02:27 AM
  4. Calling function inside function. (aka nested function)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2015, 05:58 AM
  5. COUNTIF/COUNTIFS function + nested user-defined function
    By shamjamali in forum Excel General
    Replies: 1
    Last Post: 05-12-2015, 09:12 PM
  6. [SOLVED] Nested Function With Division - Receiving #VALUE! Function Error
    By DDM64 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-17-2013, 01:16 PM
  7. [SOLVED] Offset function with nested match function not finding host ss.
    By MKunert in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-21-2006, 06:50 PM

Tags for this Thread

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