trying to reference a cell in a line of text

J

jspizman

Hello,

I have 1000 ID numbers and I want to reference those ID numbers in a
line of text. Basically, I have 1000 lines of text I need to write and
want to use excel to do it. What I want to do is something like this:

if x= 'contents of A1' then i1 = 1 otherwise if x<>'contents of A1'
then i1= 0
if x= 'contents of A2' then i2 = 1 otherwise if x<>'contents of A2'
then i2=0
...
if x='contents of A1000' then i1000=1 otherwise if x<>'contents of
A1000' then i 1000=0


I am completely lost as to how to do this. Any help would be greatly
appreciated.

Thanks,
Josh
 
G

Gary''s Student

This assumes that the "if" is text and not a formula. In cell B1 enter:

="if x= " & A1 & " then i1 = 1 otherwise if x<>" & A1 & " then i1= 0"
 
Top