If Function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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(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"?
 
Peo, the second one does not seem to work since it doesn't specify anything
about the number starting with 15.
 
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"?
 
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.
 
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")
 
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..
 
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
 
...
...
=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")

?
 
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..
 
I don't think anyone would, but let me ask this:

If the cell is formatted to show some rounded version of the actual value in
the cell, the if statement wouldn't be completely accurate since it's
looking at the actual value in the cell.

If it's actually: 14.9495850698301
but it looks like : 15

Maybe this is more useful?

=+IF(--LEFT(TEXT(C5,"##"),2)=15,"Materials","Services")
 
Back
Top