two Conditional formatting

faizee

Board Regular
Joined
Jan 28, 2009
Messages
214
Office Version
  1. 2016
Platform
  1. Windows
allow to enter value in cell, only if
1. data contain 1 time "x" value between two numeric value . & both numeric values should not be more than 99,
e.g
34x45.5, (allow)......
21x56.44 (allow)
23c45.5, (not allow).
23 x 45.5 (any space not allow)
101x22 (numeric more than 99 not allow)
 
Will only work for conditional formatting.

Excel Formula:
=IF(AND(ISERROR(SEARCH(" ",B1)),IFERROR(SEARCH("""x",B1),0),RIGHT(B1,1)=""""),NOT(AND(VALUE(REPLACE(B1,SEARCH("""x",B1),95,""))<=99,VALUE(SUBSTITUTE(REPLACE(B1,1,1+SEARCH("""x",B1),""),"""",""))<=99)),NOT(IFERROR(AND(VALUE(REPLACE(B1,SEARCH("x",B1),95,""))<=99,VALUE(REPLACE(B1,1,SEARCH("x",B1),""))<=99,SEARCH("x",B1)>=1,ISERROR(SEARCH(" ",B1))),FALSE)))
 

Attachments

  • 1674812806189.png
    1674812806189.png
    32.2 KB · Views: 6
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
no. i mean any single value with inverted comma is also allowed
e.g 24" or 24.5"

34x45.5, (allow)......
21x56.44 (allow)
23c45.5, (not allow).
23 x 45.5 (any space not allow)
101x22 (numeric more than 99 not allow)
23" (allow)
23.4" (allow)
222" (more than 99 not allow)
23"x33" (two inverted comma value not allow)
23"x33 (not allow)
 
Upvote 0
Excel Formula:
=NOT(IFERROR(IFERROR(AND(REPLACE(B1,SEARCH("""",B1),95,"")+0<=99,RIGHT(B1,1)="""",SUMPRODUCT(--(MID(B1,ROW($A$1:$A$20),1)=""""))=1),AND(VALUE(REPLACE(B1,SEARCH("x",B1),95,""))<=99,VALUE(REPLACE(B1,1,SEARCH("x",B1),""))<=99,SEARCH("x",B1)>=1,ISERROR(SEARCH(" ",B1)))),FALSE))
 

Attachments

  • 1674986184718.png
    1674986184718.png
    41 KB · Views: 6
Upvote 0
thanks for reply. but it should not look values in $A$1:$A$20, it should only see value to its relevant row.
e.g. see only inverted comma value in its relevant row. 24" or 24.5"
 
Upvote 0
thanks for reply. but it should not look values in $A$1:$A$20, it should only see value to its relevant row.
e.g. see only inverted comma value in its relevant row. 24" or 24.5"
Did you even try and input the formula? The row a1:a20 is for calculation to get number from 1 to 20, it's not looking for values in a1:a20. I'm not gonna reply to this anymore. Good luck
 
Upvote 0

Forum statistics

Threads
1,223,744
Messages
6,174,253
Members
452,553
Latest member
red83

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