vlookup inside an if statement?

--------------------------------------------------------------------------------

Hi everybody!

I have to do a vertical lookup of an object that might or might not
exist, in case it doesnt exist normally it gives back Ref! but the
thing is that if this objet doesnt appear on the data base is because
is zero.

This Ref! is not allowing me to make a sum since this objet is part of
it.
Maybe with an example would be easier to explain.


i have to pull from a database the number of cars sold of three brands
A,B, C, In the database unless is one car of the type it will not
appear.
lets say we have 3 B cars, 5 C cars and no A cars

i will have as a result of three vlookups one in each celd ref!(since
there is not any A car), 3 and 5 the in other celd I have the the sum
of this three but since I have that ref! the result will be a ref! as
well!

I would like that when the vlookup doesnt find any match(like A cars in
the example) give back a zero as result instead of a Ref!

Thanks in advance
Carlos


-- 
carlosgdlf
------------------------------------------------------------------------
carlosgdlf's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=25821
View this thread: http://www.excelforum.com/showthread.php?threadid=392718

0
8/3/2005 9:36:16 PM
excel.misc 78881 articles. 5 followers. Follow

3 Replies
859 Views

Similar Articles

[PageSpeed] 50

This might be the formula that will help you ...

=IF(ISERROR(YOUR_VLOOKUP_FORMULA),0,YOUR_VLOOKUP_FORMULA)


Regards.


-- 
BenjieLop


------------------------------------------------------------------------
BenjieLop's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=11019
View this thread: http://www.excelforum.com/showthread.php?threadid=392718

0
8/3/2005 9:50:37 PM
Thanks benjie


BenjieLop Wrote: 
> This might be the formula that will help you ...
> 
> =IF(ISERROR(YOUR_VLOOKUP_FORMULA),0,YOUR_VLOOKUP_FORMULA)
> 
> 
> Regards.


-- 
carlosgdlf
------------------------------------------------------------------------
carlosgdlf's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=25821
View this thread: http://www.excelforum.com/showthread.php?threadid=392718

0
8/3/2005 10:12:10 PM
You're welcome ..

--
BenjieLo

-----------------------------------------------------------------------
BenjieLop's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1101
View this thread: http://www.excelforum.com/showthread.php?threadid=39271

0
8/4/2005 1:36:43 AM
Reply:

Similar Artilces:

using a date in vlookup
i want to perform a vlookup using the Now() function to generate the lookup value (A1), the 1st column in the table [col B] array will be all the dates in a year listed consequtive,, and the 2nd column being a value assigned to each day in the 1st column [B]. My formula is vlookup(A1,B1:C367,2). The result I get is "#N/A. What am i doing wrong? Thanks Tonso NOW() returns both the date and the time, so you would be better off using TODAY(), which only returns the date. Another problem might be that your dates in column B are really text values that just look like dates - see what happe...

Balancing to Online Bank Statement--Can't Reconcile
I am a Quicken user eager to make the change to Money. However, I am used to balancing my bank register after every download of transactions in quicken, and find I cannot do this in Money. In Quicken, I would donwload and accept transactions. Then click "RECONCILE," and then be given an option to use the downloaded balance information or use a paper statement. If I used the downloaded balance, all was well, marked as reconciled and my register and bank balance always balanced. In Money, I download, accept transactions, and when I click "reconcile," I am only g...

Count days inside 2 dates
Sorry, I have been trying all sorts of different formulas to get this right. I need a formulae that can calculate the numbers of day in C A guest arrives on A, left on B, total numbers of days on C. A B C 10/12/2008 11/12/2008 1 (days) 31/12/2008 03/01/2009 3 Much appreciated! Assume startdates in A2 down, enddates in B2 down Then in C2: =B2-A2 Format C2 as general (via Format>Cells), then copy down -- Max Singapore http://savefile.com/projects/236895 Downloads:19,000 Files:362 ...

Reference another workbook (variable name) inside a formula cell
I use a formula to reference a another workbook cell. The other workbook name can changes after sent to another party and returned ammended. Rather than change the name of the spreadsheet, I would prefer to change the reference in a cell of the first spreadsheet. The formula below activates the lookup if cell c75 is Y. I would like to replace the text [Midwest G1 5000.xls] with a cell containing the name. =IF($C75="Y",SUMIF('[Midwest G1 5000.xls]Summary'!$B:$B,F$4,'[Midwest G1 5000.xls]Summary'!$J:$J),0) I have tried using "&" and direct cell references...

vlookup excel and access...
assuming i have this code, is possible to use this vlookup withnthe adta into mdb access?... old scenario: Private Sub TextBox25_Change() Dim CODICE As Integer Select Case Me.TextBox25 Case "" Me.TextBox4 = "" Case 1 To 8 CODICE = Val(Me.TextBox25) Me.TextBox4 = Application.WorksheetFunction.VLookup _ (CODICE, Worksheets("TABELLA").Range("Q2:R9"), 2, False) Case Else Call MULTI_LINE_BOX End Select End Sub new scenario: Inested column Q and R in excel i have created a mdb into: \\my server\myserverdir\USER.MDB and into this mdb have inserte a table U...

Vlookup within a vlookup
I am trying to lookup a cell within a table - but the table to use is found in another table. =VLOOKUP(B3,VLOOKUP(B2,F3:G9,2,2),2) Cell B2 is a dropdown box allowing one of the choices in colum f below. Column G represents which table to use for the initial lookup based on your choice in the drop down dox. column f column g Alt A 30 Yr fixed30 Alt A 15 Yr fixed15 All I get is an error - can someone help ? Thanks, Yosef It sounds like you would need to use INDIRECT within the lookup formula http://tinyurl.com/czxtt that thread shows the way to do it exce...

Lost on Vlookup, match, etc....
Can someone walk me through this please? I a workbook that imports a years worth of data from filemaker to be analyzed and charted in excel. It contains several sheets, but I am concerned with worksheet 1 (daily data) and worksheet 2 (bodyweight). Daily data contains the raw data I pull in from Filemaker. It results in a table with a row for each day of the year. It has 12 columns, but in this instance, I am only interested in 2 of the colums Column F, (Date), and Column R (Bodyweight). There is only one entry per week for body weight. The bodyweight sheet has 3 columns (week #, date, and w...

VLOOKUP in VBA
On the worksheet I can insert in a cell =VLOOKUP(C5, Hobokee.xls!AcsLow, 2) and it works perfectly, looks up the value in column 2 of the range named AcsLow in the same workbook. But elswhere I want in a macro to lookup the same table and assign the result to a variable BalAmt. BalAmt = VLOOKUP(AccNum, Hobokee.xls!AcsLow, 2) does not work. It gives a function not defined error on Hobokee. If instead of Hobokee I put Workbooks("Hobokee"), it gives function not defined error for VLOOKUP which it changes to VLookup. I have been overVLOOKUP in the Help file and see nothing wrong. W...

VLOOKUP problem
I down a list of top 100 stock symbols to Excel and place them in Column A and their rank in Column B (1-100). the next week I download a new list of the top 100 stock symbols and their rank to Column C and D respectively. then I create column E using the function =VLOOKUP(C4,A:B,2,FALSE) Which tels me the rank each stock had last week and if a stock is new this week it puts "#N/A" in the appropriate cell in column E. How do I get the Vlookup function to put "NEW" in column E if the is new to the list and wasn't in the list last week? Ed =if(isn...

VLOOKUP #40
Would like to post data from one worksheet to another. Could you provide a few more details about what exactly you want to do. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "dr" <drivera@opvista.com> wrote in message news:1f1001c52c08$ad4c33a0$a601280a@phx.gbl... > Would like to post data from one worksheet to another. ...

How to get quote marks in VBE NOT result in "end of statement"
I have some code in a user form which requires the " mark to designate inches. How do i make it not be interpreted as the "end of statement" ? On Fri, 15 Jan 2010 05:17:01 -0800, Doug G <DougG@discussions.microsoft.com> wrote: >I have some code in a user form which requires the " mark to designate >inches. How do i make it not be interpreted as the "end of statement" ? myString = "This " & chr(34) & " is a quote mark" or myString = "This " & """" & " is a quote ma...

Excel 2003, cannot import quoted fields with separators inside
Hello, I have some data in UTF-8 encoded file with comma separated and quoted values. First I create an empty spreadsheet and then go to Data | Import External Data | Import Data... After selecting the file I choose "Delimited" data type (UTF-8 encoding is recognized automatically). In the next setp I change Delimiters to "Comma" (only!). Text qualifier is already set to double quotes. I would expect in this case that value such as this: "one, two, tree" to be treated as one column. But excel breaks it into three columns 1. "one 2. two 3. three" Am...

combobox and vlookups?
I am trying to add a combobox that when you select from the dropdown menu, the columns nextdoor automatically pull up corresponding data that is related to the selection from the dropdown list. Does this make sense? What do I do to set this whole thing up? (I don't know code). Thanks. -- Message posted via http://www.officekb.com You shouldn't need code for anything you described here. Set up the combobox with the list fill range, if any. Set the linked cell to the desired cell. Then, use the VLOOKUP command in another cell to look for the linked cell from the combo box to lo...

Need an IF statement....
I have a worksheet with a list in a column that gives choices .... is it possible to put an if statement somewhere within the sheet to make the choices picked in the column with the list change color? In other words if say in Column C your choices were yes, no, maybe, not at all can you put an if statment in say Column XX that says if the answer in c is yes then the font will show as bold red, if no the bold blue and so on...... format>conditional formatting>etc -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1@austin.rr.com "TechnoGram" <mumzee3@hotmail.c...

VLOOKUP
This is a multi-part message in MIME format. ------=_NextPart_000_0001_01CAC8EE.B1306170 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, I use the VLOOKUP function to pull basic data from external data sheets, currently an example of my command looks like this: =VLOOKUP($A5,'[RT NP 67 MF.xls]ODD'!$A$1:$S$250,$L$1,FALSE) The "$AA%" is the data I am looking up and the "$L$1" is a variable to the column I am wishing to insert. The question I am trying to get an answer for concerns...

Exclude paid transactions in Open Status from statements in RM
It would be helpful to be able to run statements in the middle of a period that only showed unpaid sales/invoice transactions. Therefore I would like to see this added as an option under Statments - Print for: Exclude Fully Applied Payments and Fully Paid Sales/Invoice Transactions. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Ne...

incorporate paste value in vlookup
is there a way to incorporate "paste value" in a vlookup formula ? I have the vlookups in the column working and feeding off of the multiple worksheets. the data will be updated weekly (and new columns with the updated data added) and i would rather just copy new data on top of the old in the worksheets instean of having to add new worksheets with new data... as to keep the previous column from changing. -- problem ...

Help with IIf statement 02-19-10
I am trying to get the following to work in one of my queries. ACTION: IIF([DELETE REQUEST FOR MOCC]![MODEL] & [FSCM] & [SERIAL]=[ISR]![MODEL NUMBER] & [ISR]![CAGE] & [ISR]![SERIAL NUMBER],"DELETE", IIF([DELETE REQUEST FOR MOCC]![MODEL] & [FSCM] & [SERIAL]=[ISSUED REPORT]![MODEL NUMBER] & [ISSUED REPORT]![CAGE] & [ISSUED REPORT]![SERIAL NUMBER],"TRANSFER”)) What I am trying to accomplish is any data that is on the Delete Request for MOCC and on the ISR want it to respond with delete. If the record on Delete Request for MOCC is a...

vlookup inside an if statement?
-------------------------------------------------------------------------------- Hi everybody! I have to do a vertical lookup of an object that might or might not exist, in case it doesnt exist normally it gives back Ref! but the thing is that if this objet doesnt appear on the data base is because is zero. This Ref! is not allowing me to make a sum since this objet is part of it. Maybe with an example would be easier to explain. i have to pull from a database the number of cars sold of three brands A,B, C, In the database unless is one car of the type it will not appear. lets say we hav...

"if" statements
I have a convoluted issue and I hope I can describe it clear. I have a form (frmCloseout) that is fed from a query (qryLink). In the design mode of the form, the "detail" area shows one line. When you run the report, all the information for that contract comes in and has multiple lines on the report view. Now I need to do some calculations to show up in the detail area of the form, but need to have my query recognize a specific cost code/cost type (the first two boxes in the detail line), and if this cost code/cost type is true, then perform a calculation that incl...

Nested vlookup
My formula is: =((VLOOKUP($W$5181,Download!$A$1:$X$3403,3,FALSE))+(VLOOKUP($W$5182,Download!$A$1:$X$3403,3,FALSE)))*0.001 The formula looks up the value in "$W..."and returns the amount of orders. I alwayshave values for the first part of the lookup, but niot the second. THe issue is that if there nothing to report back for the second lookup, it gives me an "#NA" errror instead of at least returning the value for the first lookup. Any help? Thanks, TJ Wrap both Lookups in their own ISNA() wrapper to trap for that error:- =(IF(ISNA(VLookup1),0,VLookup1)+IF(ISNA(VL...

IF statement / SUM IF
I have a spread sheet with the following: In Cloum A are 4-digit division numbers, In column B are 5-digit account numbers, In cloumn C are values. I am attempting to write a formula that says: If the range in column A = 1234 and Cloumn B = 12345, then Sum the value in Column C, if not zero. Any help would be greatly appreciated. Thanks. T.R. =SUMPRODUCT((A1:A15=1234)*(B1:B15=12345)*(C1:C15)) I didn't include your "if not zero" condition because if the number is zero, it won't change the sum anyways. Dan E "T.R." <anonymous@discussions.microsoft.c...

Vlookup?
I am trying to sum the cells in column "AY" for each row that has a positive value in column "S" I am very confused and this is what I have so far. Can you help me please? =SUM(VLOOKUP($S$3:$S$502>0,$S3:$AY502,33,FALSE)) Try =SUMIF(S3:S502,">0",AY3:AY502) Hope this helps, Hutch "Doug" wrote: > I am trying to sum the cells in column "AY" for each row that has a positive > value in column "S" > I am very confused and this is what I have so far. Can you help me please? > > =SUM(VLOOKUP($S...

Why #NA when using VLOOKUP?
This is a multi-part message in MIME format. ------=_NextPart_000_000C_01C7C7AD.F7E2E420 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I'm trying to use VLOOKUP to find lowest value in a small group. The = exact sample is below: A B 1 3.0001 A=20 2 2.9442 B=20 3 2.9610 C=20 4 2.9055 D=20 5 2.9630 E=20 The formula I'm using is =3DVLOOKUP(MIN(A1:A5),A1:B5,1) . I'm trying to = get it to return the lowest cost, from column A. If I take out Row 4, = it wo...

sum function usin an IF statement
Bit short on detail, but maybe =IF(rng>10,rng) as an array formula, committed with Ctrl-Shift-Enter or =IF(rng1>some_val,rng2) again an array formula, where rng1 and rng2 are the same size. -- HTH RP (remove nothere from the email address if mailing direct) "jimk" <jimk@discussions.microsoft.com> wrote in message news:2873BFCF-598E-4956-808C-31C1638741A9@microsoft.com... > ...