# Excel Formula Needed

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

#### bitsnbytes

Can I do a formula in Excel that says: If G12 - H12= greater than 0 put \$10 in this cell (J12)?

Thanks

#### ckaas

=IF((G12-H12)>0, "10\$", "message if not")

#### bitsnbytes

GREAT! One more addition, if it = 0 or less add \$0.00

#### Gram123

ckaas' formula enters the 10\$ value as text. You'll have trouble if you want to perform any calculations on the cell.

I'd format the cell to Currency format and use:
=IF((G12-H12)>0, 10, 0)
Which says if G12 - H12 is greater than zero, enter \$10.00, otherwise enter \$0.00.

Gram

#### annalyst

I need a code similar to this that will give me a ;-) happy face when a total =0 and a ;-( when it is >1.

#### maxflia10

Originally posted by annalyst:
I need a code similar to this that will give me a ;-) happy face when a total =0 and a ;-( when it is >1.
=IF(G12-H12=0,"", ";-)")

What happens when it's =1?

#### annalyst

Thank you maxflia

=IF(G12-H12 >=1, ";-("

Got it

#### tCoop61

If you want to be really cute, format the results cell for your happy/sad faces as "wingdings", and use the following formula:

=IF(G12-H12=0,"J", "L")

This will give you smily or frowny icons. Better yet (and I've really done this myself!), put a conditional format on that cell so that if cell = "J", text is green, if cell = "L", text is red. It helps to differentiate the "sad" cells.

#### CastleHeart

XLwonders never cease!

Creative T61 !

:{)

#### annalyst

You guys are terrific
Thanks a bunch

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

As Seen On