Search in cell

  • Thread starter Thread starter Fredrik Jönsson
  • Start date Start date
F

Fredrik Jönsson

Hi

I want to search in a cell. For example; if the cells value begins with 0701
cell C1 gets a value of 1. If the cell begins with 0702 cell c1 gets a
value of 2.

How do I make this funtion?

Thank

Fredrik
 
In the example you have given =Right(YourCell,1) would return the last digit
on the right.
 
Since you say "Begins with".. and there are 0s there, does that mean they
are text formatted cells? or numbers that show a 0 in front of them?


if they are text,

=+IF(LEFT(C1,4)="0701",1,IF(LEFT(C1,4)="0702",2))


if they are actually numbers, but are formatted to show a leading 0--
=+IF(LEFT(C1,3)="701",1,IF(LEFT(C1,3)="702",2))
 
whoops - You'll need to put a formula like below into C1 and change the cell
reference to wherever the 0701 numbers are.
 
Back
Top