Excel Formula or VBA Script

I have a large file with over 65000 rows.  For each row, if there is a "Y" in any cell of columns E, F, G, H, I would like to add a a value of "OK" in column J.

Do you know of a formula that will do this?
SAMPLE-EDEL.xlsx
ArisaAnsarAsked:
Who is Participating?
 
T.J. CoueySenior EngineerCommented:
This should do it....

=IF((COUNTIF(E1:I1,"Y")),"OK","Not OK")
0
 
duncanb7Commented:
At J2 put
=IF(COUNTIF(E2:I2,"Y")>0,"OK","")

and drag the cell down to the row you want


Duncan
0
 
duncanb7Commented:
on Excel cell J2

you can do this =IF(COUNTIF(E2:I2,"Y")>0,"OK","")

on VBA,

you can do this

 Sub test()
 Range("j2").Value = "=if(countif(e2:i2," & """Y""" & ")>0,""OK"","""")"
 Range("j2").Select
 Selection.AutoFill Destination:=Range("j2:j6000")
  End Sub

Open in new window

0
 
ArisaAnsarAuthor Commented:
Thank you!  All of this worked great.  I really appreciate it.
0
 
duncanb7Commented:
Thanks for your points

Have a nice day

Duncan
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.