Conditional formatting for specific number of digits

azad092

Board Regular
Joined
Dec 31, 2019
Messages
198
Office Version
  1. 2007
Platform
  1. Windows
Dear Members
I am using a data sheet for data entry including a column call time. In call time I enter call time from 0000 to 2359 in different cells of the entire column according to my data need. some time by mistake I enter the call time which is not belong to 0000 to 2359 i.e instead of 0059 I enter 0060 or instead of 2359 I enter 2360 or 2400 which is not a correct time. In this condition I want to apply conditional formatting please help me if someone knows about it
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Something like this?

20 11 05.xlsm
C
1Call Time
20000
30255
40279
52400
6
71203
812344
9
10
CF Wrong Time
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C2:C10Expression=OR(LEN(C2)<>4,LEFT(C2,2)-23>0,RIGHT(C2,2)-59>0)textNO
 
Upvote 0
Something like this?

20 11 05.xlsm
C
1Call Time
20000
30255
40279
52400
6
71203
812344
9
10
CF Wrong Time
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C2:C10Expression=OR(LEN(C2)<>4,LEFT(C2,2)-23>0,RIGHT(C2,2)-59>0)textNO
thanks for your kind reply
you understand well, but the coding that you share is not working please guide further
 
Upvote 0
coding that you share is not working please guide further
I cannot guide further if you give me nothing to go on. For example
- what is happening (wrong values being formatted or all values being formatted or no values being formatted)

Does my sample look correct for what you want?

Can you confirm that the Call Time column is formatted as Text (since leading zeros I assume are expected in some cases)?

Did you adjust the formula to suit whatever column & rows your data is in?

What cell is the Call Time heading in on your worksheet?
 
Upvote 0
I cannot guide further if you give me nothing to go on. For example
- what is happening (wrong values being formatted or all values being formatted or no values being formatted)

Does my sample look correct for what you want?

Can you confirm that the Call Time column is formatted as Text (since leading zeros I assume are expected in some cases)?

Did you adjust the formula to suit whatever column & rows your data is in?

What cell is the Call Time heading in on your worksheet?
Hi peter
thanks for your kind reply
I have resolve the problem by making a time list, through the time list I cant control the error of irregular digits of time... but I also thankful to your for your kind attention.
 
Upvote 0
You're welcome. Glad you have resolved the problem. Thanks for letting us know. (y)
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,236
Members
448,555
Latest member
RobertJones1986

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