How do I keep from getting a #VALUE! error with text in this situation?

SuperNoodle

New Member
Joined
Nov 30, 2019
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Listen, first off I want you all to know that I've searched high and low for the answer to this question but I realize I may not know the terminology enough to find what I'm looking for. So I apologize in advance if this question has been asked.

I'm making some schedules for my employer and I've hit a snag. It currently works as intended, but the problem arises from my management staff. I'm using a MOD function to tally up the hours from scheduled times, and I want to able to allow users to type in the words "ro" and "off", because that's what they're used to doing. Of course at the current moment any written text will foul me right up and produce a VALUE! error. I think I can use a "IF isnumber" type of formula, but I'm not too savvy on how exactly to do it. Any help would be so appreciated, and thanks in advance!
excel shot.png
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
In the cell write "ro" or write "ro" and a number?
In which cell they write "ro" can be in C7 or in C7 or both?

What do you want as a result if there is a text?
In the following example, if there is an error in the formula, a zero returns:

=IFERROR(MOD(C8-C7,1)*24,0)
 
Upvote 0
Here you are. You will need to accommodate for text being entered into either the start or stop time cells. IF(AND(ISNUMBER(A2),ISNUMBER(B2)),MOD(B2-A2,1)*24,0)
 

Attachments

  • Formula.JPG
    Formula.JPG
    17.2 KB · Views: 3
Upvote 0
In the cell write "ro" or write "ro" and a number?
In which cell they write "ro" can be in C7 or in C7 or both?

What do you want as a result if there is a text?
In the following example, if there is an error in the formula, a zero returns:

=IFERROR(MOD(C8-C7,1)*24,0)

In cells C4-5 or in C7-8 would be where they would want the text to be, in place of the scheduled in and out times. If there is a text there I would like for the formula to ignore it.

I just tried your suggestion and that works perfectly! Thanks so much DanteAmor for your time and help!
 
Upvote 0
Here you are. You will need to accommodate for text being entered into either the start or stop time cells. IF(AND(ISNUMBER(A2),ISNUMBER(B2)),MOD(B2-A2,1)*24,0)

Thanks for the quick reply and the screen shot. You all on this site rock! I wished I'd had found you guys when I was taking data mining QM during my undergrad!
 
Upvote 0

Forum statistics

Threads
1,214,892
Messages
6,122,112
Members
449,066
Latest member
Andyg666

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