IF statement Problems


Posted by AL on December 27, 2001 2:15 PM

If BZ4=1 I need to lookup a name in BZ5 then find that name in AM4:BQ4 and when that name is found I need to put into CA7 the number found in row 39 under the column AM4:BQ4 that the name was found under. Ie: if the name was found in BC4 then I need to take the number in BC39 and put it in CA7.

Posted by Mike on December 27, 2001 2:57 PM

If Worksheets("Sheet1").Range("BZ4").Value Then
sname = Worksheets("Sheet1").Range("BZ5").Text
For x = 39 To 52
If sname = Worksheets("Sheet1").Cells(4, x).Text Then
Worksheets("Sheet1").Range("CA7").Value = Worksheets("Sheet1").Cells(39, x).Text
End If
Next x
End If

Posted by Cory on December 27, 2001 3:03 PM

Try this one!

This may not be what you're looking for, but try it anyway :-P in C7 enter this formula :

=IF(BZ4=1,HLOOKUP(BZ5,AM4:BQ39,36,FALSE))

Good Luck!

Cory



Posted by AL on December 27, 2001 3:15 PM

Re: Try this one!

Cory all I get is an #N/A

AL