+ Reply to Thread
Results 1 to 7 of 7

IF statement help

  1. #1
    Registered User
    Join Date
    10-24-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    IF statement help

    Hey everyone,

    now I am a newbie to this site but have some background knowledge of excel. Always you come across a problem that you know is going to be simple to answer but obtaining the answer seems to evade every thought I make.

    The IF statement I am using is:

    =IF(K11="00:00:00","",K11)

    this does not seem to work but if I enter 00:00:00 into another cell and link it that way the formula works.

    any pointers would be greatly appreciated.

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

    Re: IF statement help

    hi sandston, welcome to the forum. by 00:00:00, i think you meant it to be 12 am? if so, you need to remove the double quotes:
    =IF(K11=0,"",K11)

    by putting double quotes, you are looking for a text that says "00:00:00"

    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 Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: IF statement help

    Well, the difference is that, when you put 00:00:00 in a cell, Excel recognises it as a time ... midnight.

    But, when you put 00:00:00 in quotes in your formula, Excel sees it as a text string ... and not equal to midnight.

    Try using TIME(0,0,0) or TIMEVALUE("00:00:00")


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: IF statement help

    Do it like this:

    =IF(K11=--"00:00:00","",K11)

    The double-minus converts it from a string to a number. You could also do it like this:

    =IF(K11=0,"",K11)

    Hope this helps.

    Pete

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: IF statement help

    Three different answers in three minutes and all within ten minutes of asking. That's not bad!

  6. #6
    Registered User
    Join Date
    10-24-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: IF statement help

    Thanks so much, like I said I knew it would be something staring me right in the face but I could not pin point what it was. I have amended the formula and is working perfectly fine. Thank everyone for such a prompt response.

    @TMShucks I must agree I didn't expect a response let alone a solution so quickly thank you all again so much.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: IF statement help

    You're welcome. Thanks for the rep.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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