View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
hkslater hkslater is offline
external usenet poster
 
Posts: 4
Default Divide by Zero Error

It is the lookup values in Period1 and Period2 that are occasionally blank or
zero. E9 and F9 always have a value. How would you address that?

"T. Valko" wrote:

Your #DIV/0! error could come from either:

VLOOKUP($D9,Period1,3,FALSE)*$E9
VLOOKUP($D9,Period2,3,FALSE)*$F9

The VLOOKUP portion could be OK but if either E9:F9 are empty/0 that will
also cause the error.

I'd use a helper cell with this formula assuming that the lookup values are
always present and you don't get #N/A errors:

=IF(OR(VLOOKUP($D9,Period1,3,0)*$E9=0,VLOOKUP($D9, Period2,3,0)*$F9=0),0,"OK")

Then test that helper cell for 0:

=IF(A1=0,"",ROUNDDOWN(......))


--
Biff
Microsoft Excel MVP


"hkslater" wrote in message
...
=ROUNDDOWN((VLOOKUP($D9,Period1,VLOOKUP(I$6,Column s,3,FALSE),FALSE)/VLOOKUP($D9,Period1,3,FALSE)*$E9)+(VLOOKUP($D9,Per iod2,VLOOKUP(I$6,Columns,3,FALSE),FALSE)/VLOOKUP($D9,Period2,3,FALSE)*$F9),0)