IF Function - DIV#0!

  • Thread starter Thread starter JANA
  • Start date Start date
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
 
Hi

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