ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formula (https://www.excelbanter.com/excel-worksheet-functions/65769-formula.html)

BSantos

Formula
 
=IF($I$2="Active",VLOOKUP($E6,Data!$G$4:$AT$1587,2 8,0),"0")

I have this formula above in a cell. I want to add that if the vlookup
doesn't find anything and returns a #N/A than give me ZERO.

I'm doing this so I don't get #n/a in the column and my totals will add up
without giving me #n/a.

Any help? B.

bpeltzer

Formula
 
=IF($I$2="Active",
IF(ISNA(MATCH($E6,Data!$G$4:$G$1587,0)),
0,
VLOOKUP($E6,Data!$G$4:$AT$1587,28,0)
),"0"
)
You can get rid of all the line breaks; I was just using them to pair off
the parens. Basically, the idea is to replace the vlookup() with
if(isna(match()),0,vlookup()). That is, if a match fails (and therefore the
vlookup will fail), return 0, otherwise process the lookup.
--Bruce

"BSantos" wrote:

=IF($I$2="Active",VLOOKUP($E6,Data!$G$4:$AT$1587,2 8,0),"0")

I have this formula above in a cell. I want to add that if the vlookup
doesn't find anything and returns a #N/A than give me ZERO.

I'm doing this so I don't get #n/a in the column and my totals will add up
without giving me #n/a.

Any help? B.



All times are GMT +1. The time now is 07:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com