# Hiding a cell if value equals X

Solved/Closed
Aimee - Jul 20, 2009 at 08:37 AM
Aimee - Jul 22, 2009 at 01:28 AM
Hello,

I want to do the following in EXCEL.

I have a formula which works out the cost of one item at \$35 plus adds \$3.8 per item thereafter. Tf the cell i am putting my equation in is D5 and the cell with the quantity of items is C5 then my equation would look as follows.

D5 = 35+((C5-1)*3.8)

So if C5 = 1 then the answer is \$35 which is correct
and if C5 = 2 then the answer is \$38.80
BUT if C5 = 0 then I want the cell to display Zero???? ANY IDEAS?

## 1 response

Hello Aimee,

Use the IF function:

=IF(35+((C5-1)*3,8)<35;0;35+((C5-1)*3,8))

If the result of your formula is smaller then 35 then display a 0,
If the result of your formula is the same or bigger then 35 then display the result of your formula.

Hope this is what you were looking for.

Best regards,
Trowa
Hi Trowa,

Thanks for your help! New it would need an IF formula but had no clue how to word it!

Yours looks like it should work, but when I try type it in excel it gives me an error saying that "The formula you typed contains an error" any ideas on why?

Really hope you can help!

Aimee
Sorry,

Tried it again and it does work!

Thanks a million!
Hi Trowa,

Worked out what was wrong, in your formula you had ; where it should of been , !

So happy to finally have the answer to this! You are a lifesaver!