# Excel Formula Needed

Discussion in 'Business Applications' started by bitsnbytes, Sep 26, 2003.

Not open for further replies.

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

Thanks

2. ### ckaas

Joined:
Feb 3, 2003
Messages:
133
=IF((G12-H12)>0, "10\$", "message if not")

Joined:
Sep 26, 2003
Messages:
8
GREAT! One more addition, if it = 0 or less add \$0.00

4. ### Gram123

Joined:
Mar 15, 2001
Messages:
1,829
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

5. ### annalyst

Joined:
Dec 28, 2002
Messages:
36
I need a code similar to this that will give me a ;-) happy face when a total =0 and a ;-( when it is >1.

6. ### maxflia10

Joined:
Feb 24, 2003
Messages:
331
=IF(G12-H12=0,"", ";-)")

What happens when it's =1?

7. ### annalyst

Joined:
Dec 28, 2002
Messages:
36
Thank you maxflia

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

Got it

8. ### tCoop61

Joined:
Aug 5, 2003
Messages:
47
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.

9. ### CastleHeart

Joined:
May 4, 2002
Messages:
743
XLwonders never cease!

Creative T61 !

:{)

10. ### annalyst

Joined:
Dec 28, 2002
Messages:
36
You guys are terrific
Thanks a bunch

As Seen On