+ Reply to Thread
Results 1 to 5 of 5

Help with a long Nested IF Statement with AND as well I think

  1. #1
    Forum Contributor
    Join Date
    02-09-2007
    Location
    UK
    MS-Off Ver
    2019 & 365
    Posts
    304

    Help with a long Nested IF Statement with AND as well I think

    Problem Solved.
    Attached Files Attached Files
    Last edited by Badvgood; 10-15-2015 at 09:46 AM. Reason: Solved

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Help with a long Nested IF Statement with AND as well I think

    hi there. 2 ways:
    1.
    =IF(COUNTIF(Z3:AB3,40)=1,40,IF(AND(AB3=0,Z3=40,AA3=40),80,IF(COUNTIF(Z3:AB3,40)=2,100,IF(COUNTIF(Z3:AB3,40)=3,150,0))))

    2. do a list of your criteria. for eg in AG2:AI2 are your GAP, Ext.Warr, Paint.
    AG3: 0
    AH3: 0
    AI3: 40
    do a formula in AJ3:
    =AG3&"_"&AH3&"_"&AI3
    in AK3:
    40
    so it means this combination should return you 40. do another combination in row 4. that would be 40, 0, 0. in row 5 - 40, 0, 40.
    then in AC3:

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Contributor
    Join Date
    02-09-2007
    Location
    UK
    MS-Off Ver
    2019 & 365
    Posts
    304

    Re: Help with a long Nested IF Statement with AND as well I think

    Quote Originally Posted by benishiryo View Post
    hi there. 2 ways:
    1.
    =IF(COUNTIF(Z3:AB3,40)=1,40,IF(AND(AB3=0,Z3=40,AA3=40),80,IF(COUNTIF(Z3:AB3,40)=2,100,IF(COUNTIF(Z3:AB3,40)=3,150,0))))

    2. do a list of your criteria. for eg in AG2:AI2 are your GAP, Ext.Warr, Paint.
    AG3: 0
    AH3: 0
    AI3: 40
    do a formula in AJ3:
    =AG3&"_"&AH3&"_"&AI3
    in AK3:
    40
    so it means this combination should return you 40. do another combination in row 4. that would be 40, 0, 0. in row 5 - 40, 0, 40.
    then in AC3:
    Perfect, thank you so much.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Help with a long Nested IF Statement with AND as well I think

    Your blank cells are really 0 formatted to show -
    This formula follows the language that you use to describe the criteria.
    This entered in AC3 and filled down should cover all your possibilities
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Registered User
    Join Date
    04-22-2009
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Help with a long Nested IF Statement with AND as well I think

    Probably more elegant ways but I added column AC after Paint and moved your Total to column AD for this. Then in relevant rows in column AC copy:

    =BIN2DEC(IF(Z3=$I$1,1,0)&IF(AA3=$J$1,1,0)&IF(AB3=$K$1,1,0))

    This converts your various possible outcomes to a unique decimal case number 0-7 which you can then use in your nested IF statement in your Total column:

    =IF(AC3=0,0,IF(AC3=1,40,IF(AC3=2,40,IF(AC3=3,100,IF(AC3=4,40,IF(AC3=5,100,IF(AC3=6,80,IF(AC3=7,150,0))))))))

+ 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. Long nested if statements
    By mufakkir in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 01-22-2015, 05:06 AM
  2. Need Alternative to very long nested if statement
    By Jay Stolzenberg in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-06-2013, 06:39 PM
  3. Formula too long (nested if statement) - can't record to vba
    By Bear00 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2012, 09:58 AM
  4. Long Nested IFs
    By disturbed in forum Excel General
    Replies: 5
    Last Post: 02-12-2011, 04:59 AM
  5. Long nested formula in VBA
    By cheerockracy in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-23-2009, 05:06 PM
  6. Replies: 6
    Last Post: 01-14-2009, 06:59 PM
  7. Formula too long - Nested IF statement with VLOOKUP
    By FurniKing in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-26-2006, 04:34 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