If Function

F

Felicia

How do I do an IF function on this: If the 1st 2 characters in a cell are "15" return the word "Services, if not return the word "Materials"?
 
P

Peo Sjoblom

=IF(LEFT(A2,2)="15","Services","Materials")

or

=CHOOSE(ISNUMBER(--LEFT(K6,2))+1,"Materials","Services")

--

Regards,

Peo Sjoblom


Felicia said:
How do I do an IF function on this: If the 1st 2 characters in a cell are
"15" return the word "Services, if not return the word "Materials"?
 
D

Dave R.

Peo, the second one does not seem to work since it doesn't specify anything
about the number starting with 15.
 
K

Kevin M

Felicia,
the formula should be this:
=IF((ISNUMBER(FIND("15",A1))),"Services","Materials")
this will find 15 anywhere in the cell, so if there's a
chance that 15 exists anywhere else in the cell, this
won't work for you.
HTH
Kevin M
-----Original Message-----
How do I do an IF function on this: If the 1st 2
characters in a cell are "15" return the word "Services,
if not return the word "Materials"?
 
P

Peo Sjoblom

I forgot to change the cell ref to A2 to make it uniform with the first,
maybe you used it and had the data
in A2, just change K6 to A2 and it should work.
 
D

Dave R.

Hi Peo. Not to beat a dead horse or anything, but I changed the reference
cell to A1 no luck there either. Since there's no reference to the numbers
'15' I don't see it working. It only sees if there's a number or not as far
as I see, not anything specific about the number.


=CHOOSE(ISNUMBER(--LEFT(A1,2))+1,"Materials","Services")
 
P

Peo Sjoblom

Thanks for the heads-up

=CHOOSE(ISNUMBER(FIND("15",K6))+1,"Materials","Services")

I used part of the first formula when I did the second..
 
R

Ron Rosenfeld

How do I do an IF function on this: If the 1st 2 characters in a cell are "15" return the word "Services, if not return the word "Materials"?

=IF(LEFT(A1,2)="15","Services","Materials")


--ron
 
H

Harlan Grove

...
...
=CHOOSE(ISNUMBER(FIND("15",K6))+1,"Materials","Services")
...

Someone has to ask: why should anyone use this rather than the other formula you
proposed:

=IF(LEFT(A2,2)=15,"Materials","Services")

?
 
P

Peo Sjoblom

Harlan Grove said:
...
..
..

Someone has to ask: why should anyone use this rather than the other formula you
proposed:

=IF(LEFT(A2,2)=15,"Materials","Services")

?


None whatsoever, I was bored..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top