Adding negative numbers when the cell is blank
I have a formula to add different columns of clocking in and out times. I have it set up to show the Clock In times as negative and Clock Out times as positive in order to get the total for the day. However if the lunch time below are blank I get an #invalid operation. Guessing because the Lunch time in has the negative in front?
=-[Start Day - Time In Total Hours]@row + [Lunch - Time Out Total Hours]@row + -[Lunch - Time In Total Hours]@row + [End Day - Time Out Total Hours]@row
Any ideas on how to add when lunch times are blank?
Thank you!!
Best Answer
-
You can add IFERROR statements around your two negative functions so that if there's an error it returns 0 instead of -0
Try this:
=IFERROR(-[Start Day - Time In Total Hours]@row, 0) + [Lunch - Time Out Total Hours]@row + IFERROR(-[Lunch - Time In Total Hours]@row, 0) + [End Day - Time Out Total Hours]@row
Cheers,
Genevieve
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
Answers
-
You can add IFERROR statements around your two negative functions so that if there's an error it returns 0 instead of -0
Try this:
=IFERROR(-[Start Day - Time In Total Hours]@row, 0) + [Lunch - Time Out Total Hours]@row + IFERROR(-[Lunch - Time In Total Hours]@row, 0) + [End Day - Time Out Total Hours]@row
Cheers,
Genevieve
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
-
Oh thank you so much!! That does it!!
-
No problem at all! 🙂
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 66.1K Get Help
- 430 Global Discussions
- 149 Industry Talk
- 490 Announcements
- 5.2K Ideas & Feature Requests
- 85 Brandfolder
- 154 Just for fun
- 74 Community Job Board
- 500 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 305 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!