+ Reply to Thread
Results 1 to 6 of 6

if/else statements

  1. #1
    Registered User
    Join Date
    10-18-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    25

    if/else statements

    Hi I am trying to complete a formula whereby I have four columns, of these four the first 3 will only ever had 1 completed so lets say its column a,b or c there will only ever be a 1 in one of these columns I then need to determine if there is a 1 in column d,

    so basically the formula would in basic terms be something like this:

    if d1=1 and a1 = 1 then 650, if d1 and b1 then 700, if d1 and c1 then 350

    I would need this to be for all cells in the columns and totals at the bottom?

    Is this possible and if so any pointers on how I go about it?

    Hope I have explained this correctly
    Last edited by turnej; 10-19-2011 at 04:36 PM.

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: if/else statements

    How about:

    Please Login or Register  to view this content.
    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Registered User
    Join Date
    05-17-2009
    Location
    Port St. Lucie, FL
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: if/else statements

    turnej,
    Here is another solution:

    A B C D E
    "= IF(AND(D1=1,A1=1),650,(IF(AND(D1=1,B1=1),700,(IF(AND(D1=1,C1=1),350,"?")))))"

    Type the formula without the first and last " marks.
    hth

  4. #4
    Registered User
    Join Date
    10-18-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: if/else statements

    Hi,

    Thanks very much for your reply on this can you possibly explain this to me slightly as I am a complete novice on excel but would love to have an understanding so I can begin to write my own formula etc

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: if/else statements

    What both are using above are Nested If statements. Flo's formula more closely mimics how you asked the question using the AND function. i.e. the first part of that formula would read "If Both D1 =1 and A1 = 1 then cell = 650, otherwise ....."
    ConneXion simplifies this a bit removing the repetitive task of looking at D1 by separating that out into the initial IF statement like so
    If it's true that D1 = 1, then if A1 = 1.. other conditions...., otherwise leave blank ("")

    Here's a short tutorial on Nested IF statements. You can google for more.

    http://spreadsheets.about.com/od/tip.../nested_if.htm
    Hope that helps.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  6. #6
    Registered User
    Join Date
    10-18-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: if/else statements

    that's brilliant thanks all

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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