Consulting

Results 1 to 6 of 6

Thread: Solved: Multiple IF statement (??)

  1. #1
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location

    Solved: Multiple IF statement (??)

    Hi

    I have a spreadsheet where I want the contents of cell D6 to show the figure in cell D5, HOWEVER, if D5 = 0 then contents of cell D4 and if D4 is = 0 then celll D3.

    Any help appreciated,

    Cheers
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Try

    =IF(D5<>0,D5,IF(D4<>0,D4,D3))
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location
    Fantastic Bob,

    Thanks for your help - I get myself bogged down at times trying to find a complex way of doing things, you as usual make it look so simple,

    Thanks again

    Gerry
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  4. #4
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location
    Sorry about this Bob,

    Knew it couldn't be that easy.

    In cell D5 the user has a formula that links to another cell with a formula.

    This means that your formula is now showing d4 instead of 0 (???)

    Is there a way to do what you did except put a zero if the formula is returning no value??
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Is this what you mean Gerry?

    =IF(LEN(D5)>0,D5,IF(LEN(D4)>0,D4,D3))
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  6. #6
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location
    Bob - Brilliant!

    That is exactly what I needed.

    Thanks again Bob

    Gerry
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •