Formula to ignore blank cells

MRSWIN2709

New Member
Joined
Nov 21, 2024
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
I am working on an excel time sheet. I have 2 groups of time in/time out and I have a column where X = no lunch (+30 mins) and blank/no X = lunch (-30 mins). I cannot figure out how to get it to skip blank cells (i.e. days not worked) and not return an error in the total column.

=IF(O12="X", ((E12-C12)+(K12-I12))+TIME(0,30,0), (((E12-C12)+(K12-I12))-TIME(0,30,0)))

Thank you in advance
 

Attachments

  • Error.jpg
    Error.jpg
    175.2 KB · Views: 1

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Welcome to the Board!

Wrap it in another IF, first checking for values in column C and E, i.e.
Rich (BB code):
=IF(AND(C12<>"",E12<>""),your original formula,"")
 
Upvote 0

Forum statistics

Threads
1,223,991
Messages
6,175,820
Members
452,672
Latest member
missbanana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top