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: 5

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
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,226,698
Messages
6,192,514
Members
453,728
Latest member
Ishtiak Mahmud

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