Forum Discussion

CheekyMonkey22's avatar
CheekyMonkey22
Copper Contributor
Dec 07, 2024

IF statement - Empty cell to be blank

Hi, I'm fairly basic with my excel knowledge. 

I have the below formula and table. The break column is a drop down box with selected times, I want the lunch column to return either a time of 12:15 or 13:15 depending on the selected break.

A break time of 10 past the hour will have a lunch at 12:15 and a break time of 11 past the hour will have a lunch at 13:15.

This formula kind of works however, I would like any unselected breaks (Cell B4) to be blank in the lunch column. 

I have tried "IFBlANK" and possible not using this correctly as I am continuously getting error messages.

Any suggestions welcome. 

Thanks.

 

  • Try this:

     

    =IF(ISBLANK(B4), "", IF(MINUTE(B4) = 10, "12:15", IF(MINUTE(B4) = 11, "13:15", "")))

     

  • Or like this:

    =IF(B2="", "", TIME(LEFT(B2, 2)+2, 15, 0))

    Format C2 as hh:mm, then fill down.

  • mathetes's avatar
    mathetes
    Silver Contributor

    Let me suggest that  you acquaint yourself with the IFS function, to allow for more than two conditions. You could test for 10, 11, ISBLANK, and any number of other conditions, providing a different response depending on which condition exists.

  • Hi - are you using =ISBIANK() or =ISBLANK()?

     

    Note that the first one is not an Excel function, hence, the error.

     

    =ISBLANK() **is** an Excel function. 

Resources