I have the following formula in a cell:
=IF($K2="STEEL",VLOOKUP($B2,'Macos 12 Mo. Data'!$A$4:$AU$326,40,FALSE),0)
Problem is that the results of this are used for calculations and K2
sometimes doesn't equal "STEEL" so I get an error. I've tried putting an
Iserror and have the error = 0 but am doing something wrong. Can you help?
|
|
0
|
|
|
|
Reply
|
Utf
|
3/12/2010 2:35:01 PM |
|
An error would occur if the VLOOKUP can not find a result. Perhaps this:
=IF($K2="STEEL",IF(ISERROR(VLOOKUP($B2,'Macos 12 Mo.
Data'!$A$4:$AU$326,40,FALSE)),0,VLOOKUP($B2,'Macos 12 Mo.
Data'!$A$4:$AU$326,40,FALSE)),0)
or
=IF(OR($K2<>"STEEL",ISERROR(VLOOKUP($B2,'Macos 12 Mo.
Data'!$A$4:$AU$326,40,FALSE))),0,VLOOKUP($B2,'Macos 12 Mo.
Data'!$A$4:$AU$326,40,FALSE))
--
Best Regards,
Luke M
"juliejg1" <juliejg1@discussions.microsoft.com> wrote in message
news:097C1C90-7B56-467A-AB77-E749B11991E6@microsoft.com...
>I have the following formula in a cell:
> =IF($K2="STEEL",VLOOKUP($B2,'Macos 12 Mo. Data'!$A$4:$AU$326,40,FALSE),0)
>
> Problem is that the results of this are used for calculations and K2
> sometimes doesn't equal "STEEL" so I get an error. I've tried putting an
> Iserror and have the error = 0 but am doing something wrong. Can you
> help?
|
|
0
|
|
|
|
Reply
|
Luke
|
3/12/2010 2:44:37 PM
|
|
Hi,
The way the formula is set up if 'steel' isn't in B2 it will return zero.
What will give an error is not find the value in B2 in the lookup range and
you can get around that by checking if the lookup value is there before
executing the vlookup
=IF(COUNTIF('Macos 12 Mo.
Data'!$A$4:$A$326,$B2)>0,IF($K2="STEEL",VLOOKUP($B2,'Macos 12 Mo.
Data'!$A$4:$AU$326,40,FALSE),0),"")
--
Mike
When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
"juliejg1" wrote:
> I have the following formula in a cell:
> =IF($K2="STEEL",VLOOKUP($B2,'Macos 12 Mo. Data'!$A$4:$AU$326,40,FALSE),0)
>
> Problem is that the results of this are used for calculations and K2
> sometimes doesn't equal "STEEL" so I get an error. I've tried putting an
> Iserror and have the error = 0 but am doing something wrong. Can you help?
|
|
0
|
|
|
|
Reply
|
Utf
|
3/12/2010 2:54:01 PM
|
|
Thank you Mike....very helpful!
"Mike H" wrote:
> Hi,
>
> The way the formula is set up if 'steel' isn't in B2 it will return zero.
> What will give an error is not find the value in B2 in the lookup range and
> you can get around that by checking if the lookup value is there before
> executing the vlookup
>
> =IF(COUNTIF('Macos 12 Mo.
> Data'!$A$4:$A$326,$B2)>0,IF($K2="STEEL",VLOOKUP($B2,'Macos 12 Mo.
> Data'!$A$4:$AU$326,40,FALSE),0),"")
>
>
> --
> Mike
>
> When competing hypotheses are otherwise equal, adopt the hypothesis that
> introduces the fewest assumptions while still sufficiently answering the
> question.
>
>
> "juliejg1" wrote:
>
> > I have the following formula in a cell:
> > =IF($K2="STEEL",VLOOKUP($B2,'Macos 12 Mo. Data'!$A$4:$AU$326,40,FALSE),0)
> >
> > Problem is that the results of this are used for calculations and K2
> > sometimes doesn't equal "STEEL" so I get an error. I've tried putting an
> > Iserror and have the error = 0 but am doing something wrong. Can you help?
|
|
0
|
|
|
|
Reply
|
Utf
|
3/12/2010 3:01:02 PM
|
|
|
3 Replies
563 Views
(page loaded in 0.246 seconds)
Similiar Articles: Using Iserror with If statement and Vlookup - microsoft.public ...vlookup from two sources - syntax of vlookup statement - microsoft ... the false in a Vlookup is the mtach type, not an value to use if the formula is false. =if ... vlookup from two sources - syntax of vlookup statement - microsoft ...the false in a Vlookup is the mtach type, not an value to use if the formula is false. =if(iserror ... How to Use VLookup in an IF Statement | eHow.com Using the ... ISNA and ISERROR functions - microsoft.public.excel.misc ...Describes how to use the ... using Excel spreadsheet functions - vlookup ... vlookup from two sources - syntax of vlookup statement - microsoft ... =if(iserror(vlookup(A1 ... How to use IsError()? - microsoft.public.access.queries ...How to use IsError()? - microsoft.public ... Avg,Sum,Count,etc. then you use the ... use multiple conditions in excel | Experiments in Finance How to use nested IF statements ... N/A Error with VLOOKUP Formula - Excel 2007 - microsoft.public ...I have even tried the IF ISERROR formula in Excel ... vlookup from two sources - syntax of vlookup statement ... How to eliminate N/A error result when using Vlookup ... Using VLookup with 2 Workbooks - microsoft.public.excel.worksheet ...... false)" Debug.Print StSpecialist If IsError ... vlookup from two sources - syntax of vlookup statement - microsoft ... Using VLookup with 2 Workbooks ... Application.VLookup and External files - microsoft.public.excel ...res = application.vlookup("prm 8018539", iprrng, 2, false) if iserror(res) then res ... Answer : External file VBA Vlookup ... How to Use VLookup in an IF Statement ... Returning Multiple values from A Vlookup - microsoft.public.excel ...... formula only return the first one it finds =IF(ISERROR(VLOOKUP($C$6 ... 4 7 10 15 15 20 If there a formula where I do a vlookup for 1, it will return 20 ... How to Use ... VLOOKUP returns incorrect data - microsoft.public.excel.worksheet ...Hi, Try this =if(iserror(vlookup(A3,B4:100,2,0 ... Vlookup Return A Formula Instead Of A Value? Hi, The main ... show how to use a VLOOKUP formula to pull data from ... VLOOKUP in VBA - microsoft.public.excel.worksheet.functions ...... res = Application.VLookup(ABC, myRng, 2, True) If IsError(res ... VBA Vlookup - Use the Excel Vlookup ... that you need to is to use "worksheetfunction" statement ... Using Iserror with If statement and Vlookup - ExcelBanterExcel Worksheet Functions ... I have the following formula in a cell: =IF($K2="STEEL",VLOOKUP($B2,'Macos 12 Mo ... An error would occur if the VLOOKUP can not find a ... Using Iserror with If statement and Vlookup ExcelExcel - Using Iserror with If statement and Vlookup. Asked By juliejg1 on 12-Mar-10 09:35 AM. I have the following formula in a cell: =IF($K2="STEEL",VLOOKUP($B2 ... Using Iserror with If statement and Vlookup - microsoft.public ...vlookup from two sources - syntax of vlookup statement - microsoft ... the false in a Vlookup is the mtach type, not an value to use if the formula is false. =if ... Tip of the Week - Tips & Tricks for Excel, Word, Powerpoint, and ...Example 2: VLOOKUP with ISERROR. One answer is to use an ISERROR statement. ISERROR simply tests an argument to see if it results in an error or not. Preventing a Vlookup Function From Returning an Error When an ...Financial Statements.xls; 3 eBook in CD-ROM; Excel 2007; Excel 2007 for Accountants ... Use the IF, ISERROR, and VLOOKUP functions as shown in the following formula: 7/28/2012 12:13:29 PM
|