change numbers to text

T

thanks

Hello,

If a have a colum with numbers and want to convert the numbers >=7 to "YES"
and the numbers <7 to "NO", what formula should I use?

Example
A
9
10
2
With the formula I must see:
A
YES
YES
NO

Thank you!
 
B

Bob Phillips

=IF(A1>=7,"YES","NO")

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

Code?

iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 to iLastRow
If Cells(i,"A").Value >=7 Then
Cells(i,"A").Value = "YES"
Else
Cells(i,"A").Value = "NO"
End If
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
G

Gord Dibben

For <7 and >7 use a helper column and this formula copied down that column.

=IF(A1>7,"YES","NO")

What do you want to do with numbers that are exactly 7?

=IF(A1>7,"YES",IF(A1<7,"NO",7)) will return 7 if 7, otherwise YES or NO.


Gord Dibben Excel MVP
 
C

CLR

After putting the formula in B1, highlight B1 and you will see a little
black square in the lower right corner of the cell........just double-click
on that square and the formula will automatically copy itself down column B
as far as you have data in column A..........

Vaya con Dios,
Chuck, CABGx3
 
Top