Need formula for Data Validation

Aswinraj

Board Regular
Joined
Dec 10, 2015
Messages
65
Hello Friends,

I need your help in finding out the formula for Data Validation.


I have 2 Columns (A,B) - Need formula to validate the Serial Number.
Formula condition should be Column A Should always starts with "S" and after 5 Digits it should contain "ID" and after 3 digits it should contain "W" (Or Last 4 Digit should start with "W")


Column A Column B

S26412ID469W1820

Please help me with the Formula.

With Regards,
Aswinraj A
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Does it matter whether it's "W" or "w", or "S" or "s"?
 
Upvote 0
Hi Rory,

"S" or "s" it doesn't matter. (Either Small or capital)



With Regards,
Aswinraj A
 
Last edited:
Upvote 0
Hi hope u got it sorted if not here is this
=IF(LEFT($A1,1)="s",1,0)+IF(MID($A1,7,2)="id",1,0)+IF(MID($A1,12,1)="w",1,0)
it everything is correct it = 3, if only 2 correct =2 then u can get condition format color on cells b to go green (or whatever color) if =3
 
Upvote 0
Hi hope u got it sorted if not here is this
=IF(LEFT($A1,1)="s",1,0)+IF(MID($A1,7,2)="id",1,0)+IF(MID($A1,12,1)="w",1,0)
it everything is correct it = 3, if only 2 correct =2 then u can get condition format color on cells b to go green (or whatever color) if =3


Hi Bro,

Thanks a lot for your help :)

Yeah i too find out another formula "=IF(AND(LEFT(T2,1)="S",MID(T2,7,2)="ID",MID(T2,12,1)="W"),"True","False")"
 
Upvote 0
You don't need the IF since AND will return either True/False:

=AND(LEFT(T2,1)="S",MID(T2,7,2)="ID",MID(T2,12,1)="W")

although just be aware that that won't check for digits in between.
 
Last edited:
Upvote 0
You don't need the IF since AND will return either True/False:

=AND(LEFT(T2,1)="S",MID(T2,7,2)="ID",MID(T2,12,1)="W")

although just be aware that that won't check for digits in between.


Ok RoryA - I understand your formula now. I need a small change in this formula,

MID(T2,12,1)="W" - This might be either W or X, how to incorporate this change?



 
Upvote 0
You could do this:

=AND(LEFT(T2,1)="S",MID(T2,7,2)="ID",OR(MID(T2,12,1)={"W","X"}))
 
Upvote 0

Forum statistics

Threads
1,223,703
Messages
6,173,977
Members
452,540
Latest member
haasro02

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