+ Reply to Thread
Results 1 to 4 of 4

if statement returning blanks

  1. #1
    Registered User
    Join Date
    09-22-2009
    Location
    Arizona
    MS-Off Ver
    Excel 2007
    Posts
    6

    if statement returning blanks

    I have a cell with the following conditions:

    if b2="a" then b3
    if b2 does not equal "a" then look at b3
    if b4="a" then b5, otherwise leave cell blank.

    I tried to use a nested if function like this:

    if(b2="a", b3, if(b4="a", b5, " ")) but it doesn't seem to be working. my cell values are formatted as times (1:30 PM) and some of the times are past midnight. I don't know if that makes a difference. The formula is working in some cells, but just blank in others, but I am not getting any error messages.

    Any help would be greatly appreciated.

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

    Re: if statement

    Formula looks like it should work.. can you post sample worksheet?
    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
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: if statement returning blanks

    Please Login or Register  to view this content.
    Your formula doesn't match the description.
    If b2 does not equal "a" then formula looks at b4, instead of b3 [per your description].

    May be it's just a typo, but I just want to make sure you know about it.
    modytrane.

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

    Re: if statement returning blanks

    Another small note. At the end of your formula,
    " " puts a space into the cell, not a blank. "" is more commonly used.
    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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