IF Function - DIV#0!

J

JANA

I'm doing a very simple formula dividing salary by hours
to get a rate. I'm doing this for multiple employees
over multiple months, so I'm just dragging and dropping
the formula. However, if there is a month when an
employee has no hours I obviously get DIV#0!. I've tried
to do an IF formula so if that is the case it will give a
result of 0 in the cell, but can't get it to work. I'm
either doing it wrong or need to use another function.
PLEASE HELP!
Thanks,
Jana
 
A

Andy B

Hi

Try this:
=IF(A2=0,"",B2/A2)
assuming the 'hours worked' value is in A2 and salary is in B2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top