ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Test for Single Character That is in an Array (https://www.excelbanter.com/excel-worksheet-functions/6231-test-single-character-array.html)

scallyte

Test for Single Character That is in an Array
 
Cell D116 on my worksheet contains the character "C".

Another cell on the worksheet contains the (non-working) test:

=IF(D116 LIKE "A..L", "yes", "no")

This doesn't work. I want it to return "yes" because the character
"C" is in the array "A..L" but I can't figure out how to do this. I
could accomplish this using VB, but would rather use a worksheet
function.

JulieD

Hi

one way
=IF(D116=CHAR(65),IF(D116<=CHAR(76),"yes","no")," no")

Cheers
JulieD


"scallyte" wrote in message
m...
Cell D116 on my worksheet contains the character "C".

Another cell on the worksheet contains the (non-working) test:

=IF(D116 LIKE "A..L", "yes", "no")

This doesn't work. I want it to return "yes" because the character
"C" is in the array "A..L" but I can't figure out how to do this. I
could accomplish this using VB, but would rather use a worksheet
function.




Frank Kabel

Hi
maybe try:
=IF(AND(CODE(D116)=CODE("A"),CODE(D116)<=CODE("L" )),"yes","no")

--
Regards
Frank Kabel
Frankfurt, Germany

"scallyte" schrieb im Newsbeitrag
m...
Cell D116 on my worksheet contains the character "C".

Another cell on the worksheet contains the (non-working) test:

=IF(D116 LIKE "A..L", "yes", "no")

This doesn't work. I want it to return "yes" because the character
"C" is in the array "A..L" but I can't figure out how to do this. I
could accomplish this using VB, but would rather use a worksheet
function.




All times are GMT +1. The time now is 04:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com