If formula question

kluitna

Board Regular
Joined
Mar 10, 2002
Messages
75
This seems very simple but for some reason I can not get it to work for me.

What I have it a Vlookup in a sereis of cells that ultimately are added together and summed.

In the column that adds the values together I place the following if formula:
=+IF(E9="#N/A",0,D9*E9)

The idea being if there is no value for the lookup table to lookup up it places a #N/A in that cell, which in turn wreaks havoc on my addition cell and well screws the column summing all up. so I thought I might out smart excel and tell it to place a zero in the addition column when ever it sees the #n/a, this did not work , it just place #n/a in the addition cell. I don't know why it did not work. Anyone out there know where I am going wrong here?

Thanks in advance
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
don't know if this is a typo, but equations start

=IF...

and not

=+IF...

Anyway, I normall adjust the VLOOKUP to take care of this in one go... using the TYPE function that returns value 16 in the case of an error...

for example...


=VLOOKUP(A1,rangename,2,false)

...would become...

=IF(TYPE(VLOOKUP(A1,rangename,2,false))=16,0,VLOOKUP(A1,rangename,2,false))

...or you could substitute this 0 value for a text string like "-" for display purposes, etc... alternatively, in the cell you were trying to put your original solution, you could use...

=IF(TYPE(E9)=16,0,D9*E9)
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,174
Members
448,870
Latest member
max_pedreira

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top