Where no value, display "NA" - if statement?

C

Carlee

Good morning all,

Issue: I use the following formula to display data:

=SUMPRODUCT(--('Daily Reading Master
Log'!B$3:B$211>=DATEVALUE("02/01")),--('Daily Reading Master
Log'!B$3:B$211<=DATEVALUE("2/28")),'Daily Reading Master
Log'!BW$3:BW$211)/SUMPRODUCT(--('Daily Reading Master
Log'!B$3:B$211>=DATEVALUE("02/01")),--('Daily Reading Master
Log'!B$3:B$211<=DATEVALUE("2/28")))

Problem:
Where this calculation is performed on a set of data that has no values, I
get the 'DIV/0' error. I understand why this occurs, however:

Question:
How can i add an 'IF' component to this equation, such that if the result of
hte calculation is 'DIV/0, display 'N/A', rather than the DIV/0 error

Many thanks in advance,
 
P

Pete_UK

You get #DIV/0 when the denominator is zero, so this is what you need
to check for. Try this:

=IF(SUMPRODUCT(--('Daily Reading Master Log'!B$3:B
$211>=DATEVALUE("02/01")),--('Daily Reading Master Log'!B$3:B
$211<=DATEVALUE("2/28")))=0,"NA",SUMPRODUCT(--('Daily Reading Master
Log'!B$3:B$211>=DATEVALUE("02/01")),--('Daily Reading Master Log'!B$3:B
$211<=DATEVALUE("2/28")),'Daily Reading Master Log'!BW$3:BW$211)/
SUMPRODUCT(--('Daily Reading Master Log'!B$3:B
$211>=DATEVALUE("02/01")),--('Daily Reading Master Log'!B$3:B
$211<=DATEVALUE("2/28"))))

Hope this helps.

Pete
 

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

Similar Threads

If Statement 1
Desparate..please help 4
If statement trouble 3
If Statement 2
Using SumProduct in Code 2
Named Ranges in Functions 2
Reference a Sheet in Formula 3
Nested If Statement 7

Top