Add IFERROR to formula
Hello,
I have a tricky formula question. If I want to add a IFERROR to the following formula where would I go about inserting it?
=(((IF(LEFT([End Time (HH:MM)]@row, FIND(":", [End Time (HH:MM)]@row) - 1) = "12", IF(OR(FIND("a", [End Time (HH:MM)]@row) > 0, FIND("p", [End Time (HH:MM)]@row) > 0), 0, 12), VALUE(LEFT([End Time (HH:MM)]@row, FIND(":", [End Time (HH:MM)]@row) - 1))) + IF(FIND("p", [End Time (HH:MM)]@row) > 0, 12)) * 60 + VALUE(MID([End Time (HH:MM)]@row, FIND(":", [End Time (HH:MM)]@row) + 1, 2))) - ((IF(LEFT([Start Time (HH:MM)]@row, FIND(":", [Start Time (HH:MM)]@row) - 1) = "12", IF(OR(FIND("a", [Start Time (HH:MM)]@row) > 0, FIND("p", [Start Time (HH:MM)]@row) > 0), 0, 12), VALUE(LEFT([Start Time (HH:MM)]@row, FIND(":", [Start Time (HH:MM)]@row) - 1))) + IF(FIND("p", [Start Time (HH:MM)]@row) > 0, 12)) * 60 + VALUE(MID([Start Time (HH:MM)]@row, FIND(":", [Start Time (HH:MM)]@row) + 1, 2)))) / 60
Best Answer
-
It depends on what exactly you are wanting to accomplish. If you are just trying to output (for example) a blank when the formula generates an error, you would wrap the whole thing in the IFERROR:
=IFERROR(original_formula, "")
Answers
-
It depends on what exactly you are wanting to accomplish. If you are just trying to output (for example) a blank when the formula generates an error, you would wrap the whole thing in the IFERROR:
=IFERROR(original_formula, "")
-
That's exactly what I am looking to do but get an unparseable error.
=IFERROR(((IF(LEFT([End Time (HH:MM)]@row, FIND(":", [End Time (HH:MM)]@row) - 1) = "12", IF(OR(FIND("a", [End Time (HH:MM)]@row) > 0, FIND("p", [End Time (HH:MM)]@row) > 0), 0, 12), VALUE(LEFT([End Time (HH:MM)]@row, FIND(":", [End Time (HH:MM)]@row) - 1))) + IF(FIND("p", [End Time (HH:MM)]@row) > 0, 12)) * 60 + VALUE(MID([End Time (HH:MM)]@row, FIND(":", [End Time (HH:MM)]@row) + 1, 2))) - ((IF(LEFT([Start Time (HH:MM)]@row, FIND(":", [Start Time (HH:MM)]@row) - 1) = "12", IF(OR(FIND("a", [Start Time (HH:MM)]@row) > 0, FIND("p", [Start Time (HH:MM)]@row) > 0), 0, 12), VALUE(LEFT([Start Time (HH:MM)]@row, FIND(":", [Start Time (HH:MM)]@row) - 1))) + IF(FIND("p", [Start Time (HH:MM)]@row) > 0, 12)) * 60 + VALUE(MID([Start Time (HH:MM)]@row, FIND(":", [Start Time (HH:MM)]@row) + 1, 2)))),"") / 60, "")
-
Looks like you may be missing an opening parenthesis at the beginning. Tyr this...
=IFERROR((((IF(LEFT([End Time (HH:MM)]@row, FIND(":", [End Time (HH:MM)]@row) - 1) = "12", IF(OR(FIND("a", [End Time (HH:MM)]@row) > 0, FIND("p", [End Time (HH:MM)]@row) > 0), 0, 12), VALUE(LEFT([End Time (HH:MM)]@row, FIND(":", [End Time (HH:MM)]@row) - 1))) + IF(FIND("p", [End Time (HH:MM)]@row) > 0, 12)) * 60 + VALUE(MID([End Time (HH:MM)]@row, FIND(":", [End Time (HH:MM)]@row) + 1, 2))) - ((IF(LEFT([Start Time (HH:MM)]@row, FIND(":", [Start Time (HH:MM)]@row) - 1) = "12", IF(OR(FIND("a", [Start Time (HH:MM)]@row) > 0, FIND("p", [Start Time (HH:MM)]@row) > 0), 0, 12), VALUE(LEFT([Start Time (HH:MM)]@row, FIND(":", [Start Time (HH:MM)]@row) - 1))) + IF(FIND("p", [Start Time (HH:MM)]@row) > 0, 12)) * 60 + VALUE(MID([Start Time (HH:MM)]@row, FIND(":", [Start Time (HH:MM)]@row) + 1, 2)))) / 60, "")
-
Worked like a charm! It's always those parens that get me. Thank you so much, Paul!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.5K Get Help
- 424 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 145 Just for fun
- 62 Community Job Board
- 464 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 301 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!