ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Now With Index -- IF Function Does Not Work With Cell Reference (https://www.excelbanter.com/excel-worksheet-functions/95964-now-index-if-function-does-not-work-cell-reference.html)

Gary

Now With Index -- IF Function Does Not Work With Cell Reference
 
Actually I made a mistake. And it was not a space issue.

A1 contains the following:

=INDEX($D$1:$D$700,R15)

and it returns the "<".

If I use an IF function that says =IF(A1="<","Curly","Larry") I
get Larry.

How can I fix this so that when I reference Cell A1 I get Curly.


Thanks,


Gary


Peo Sjoblom

Now With Index -- IF Function Does Not Work With Cell Reference
 
Still works for fine me, are you sure this won't work?

=IF(TRIM(A1)="<","Curly","Larry")

check the cell in D1:D700 and make sure it hasn't a hidden space, if you
still get the error try this

=ISNUMBER(MATCH("*"&CHAR(160)&"*",D1:D700,0))

if you get TRUE you have html invisible line feed, than I'd suggest you run
this macro on D1:D700

http://www.mvps.org/dmcritchie/excel/join.htm#trimall

--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey


"Gary" wrote in message
ups.com...
Actually I made a mistake. And it was not a space issue.

A1 contains the following:

=INDEX($D$1:$D$700,R15)

and it returns the "<".

If I use an IF function that says =IF(A1="<","Curly","Larry") I
get Larry.

How can I fix this so that when I reference Cell A1 I get Curly.


Thanks,


Gary




Gary

Now With Index -- IF Function Does Not Work With Cell Reference
 
Thanks, Peo.

Your macro worked. Now that I think of it the people I got the EXCEL
file probably generated it by copying it from a WORD file.

Gary

Peo Sjoblom wrote:
Still works for fine me, are you sure this won't work?

=IF(TRIM(A1)="<","Curly","Larry")

check the cell in D1:D700 and make sure it hasn't a hidden space, if you
still get the error try this

=ISNUMBER(MATCH("*"&CHAR(160)&"*",D1:D700,0))

if you get TRUE you have html invisible line feed, than I'd suggest you run
this macro on D1:D700

http://www.mvps.org/dmcritchie/excel/join.htm#trimall

--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey




All times are GMT +1. The time now is 02:59 PM.

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