+ Reply to Thread
Results 1 to 9 of 9

Using Multiple IF statements within single formula

  1. #1
    Registered User
    Join Date
    08-08-2011
    Location
    Warwick
    MS-Off Ver
    MS365
    Posts
    53

    Using Multiple IF statements within single formula

    Hello all,

    I'm trying to put together the following formula, however I am getting an error telling me i've entered too many arguments for this function:

    Please Login or Register  to view this content.
    Basically, I need to run an If statement to say:

    IF Diesel!A5 = Y THEN perform another if statement.

    Is this at all possible or am I barking up the wrong tree?

    Thanks guys,

    - Jon
    Last edited by JonathanMoore; 09-14-2011 at 12:30 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using Multiple IF statements within single formula

    You have to CONCATENATE functions, when is the first supposed to be the result and when is the second supposed to be the result? Right now, the second isn't being included, because you have the IF(Diesel!B5="","" part taking precedence.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    08-08-2011
    Location
    Warwick
    MS-Off Ver
    MS365
    Posts
    53

    Re: Using Multiple IF statements within single formula

    Thanks for the reply NBVC.

    The formula should perform the following sequence...

    IF Diesel!A5 = Y then it should run the 2nd IF statement to see if the cell Diesel!B5 is empty. If it is empty then it should run the 1st concatenate. So IF Diesel!A5 = N then the 2nd Concatenate function should be run. However, I need the IF(Diesel!B5="","" ... part too...

    Hope this makes sense!

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using Multiple IF statements within single formula

    I think then you really want...

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-08-2011
    Location
    Warwick
    MS-Off Ver
    MS365
    Posts
    53

    Re: Using Multiple IF statements within single formula

    That partially worked (which is better than anything I've come up with yet!) But i still need the line to read:

    =IF(Diesel!A5="Y",IF(Diesel!B5="",""

    So it displays nothing if Diesel!B5 is blank. But, obviously, as soon as I put that back in i am back to square one

    Thanks for the fast response though

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using Multiple IF statements within single formula

    Above you said:

    ....see if the cell Diesel!B5 is empty. If it is empty then it should run the 1st concatenate
    which is contrary to what you are saying now...

    Maybe this?

    Please Login or Register  to view this content.
    This checks A5="Y", if it is not equal to "Y", then it runs the 2nd concat, if it is equal to "Y", then it checks B5, if B5 is blank, then blank is returned otherwise the first concat is performed....

  7. #7
    Registered User
    Join Date
    08-08-2011
    Location
    Warwick
    MS-Off Ver
    MS365
    Posts
    53

    Re: Using Multiple IF statements within single formula

    You're right NBVC... sorry for confusing the situation!

    You're code works although even if "B5" is blank it returns values from the 2nd Concatenate.

    Many thanks for all of your help so far... i'm aware that my explanations have been nothing short of poor!!

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using Multiple IF statements within single formula

    That would happen if A5 is not "Y".

    Maybe you need to word the whole requirement.. there are many ways to interpret what you want from what you have given.

    Exactly what should happen for what combination of conditions in A5 and B5?

  9. #9
    Registered User
    Join Date
    08-08-2011
    Location
    Warwick
    MS-Off Ver
    MS365
    Posts
    53

    Re: Using Multiple IF statements within single formula

    My humble appologies, I mis-copied the code you gave me - could not be more sorrry!

    It all works perfectly as per your code!!

    Thanks again!!

+ 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