Thread: Help with code
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default Help with code

Hi Greg

=IF(A1=F1,1,IF(A1=F2,2,0))
but if you want to further add f3, f4, f5 , ... then
=MATCH(A1,F1:F1000,0)
may be what you want

HTH. Best wishes Harald

"Greg" skrev i melding
...
I am trying to write a code but I can't work out how to do it.


The code is

=if(a1=f1,"1",)

How do I add

=if(a1=f2,"2","")

Thanks in advance

Greg