+ Reply to Thread
Results 1 to 52 of 52

vlookup inside an if statement?

  1. #1
    Registered User
    Join Date
    08-02-2005
    Posts
    15

    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

  2. #2
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  3. #3
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  4. #4
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  5. #5
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  6. #6
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  7. #7
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  8. #8
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  9. #9
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  10. #10
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  11. #11
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  12. #12
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  13. #13
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  14. #14
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  15. #15
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  16. #16
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  17. #17
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  18. #18
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  19. #19
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  20. #20
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  21. #21
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  22. #22
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  23. #23
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  24. #24
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  25. #25
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  26. #26
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  27. #27
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  28. #28
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  29. #29
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  30. #30
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  31. #31
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  32. #32
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  33. #33
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  34. #34
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  35. #35
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  36. #36
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  37. #37
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  38. #38
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  39. #39
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  40. #40
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  41. #41
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  42. #42
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  43. #43
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  44. #44
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  45. #45
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  46. #46
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  47. #47
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  48. #48
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  49. #49
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  50. #50
    Tim C
    Guest

    Re: vlookup inside an if statement?

    Try:

    =IF(ISERROR(YourFormula,0,YourFormula)

    Tim C

    "carlosgdlf" <[email protected]>
    wrote:

    > 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




  51. #51
    CLR
    Guest

    Re: vlookup inside an if statement?

    The normal error when VLOOKUP doesn't find a match is #N/A rather than Ref!
    To return a result of 0 instead of the #N/A, use something like
    this.........

    =IF(ISNA(YourVlookupFormula),0,YourVlookupFormula)

    Vaya con Dios,
    Chuck, CABGx3


    "carlosgdlf" <[email protected]> wrote
    in message news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




  52. #52
    RWN
    Guest

    Re: vlookup inside an if statement?

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


    The way I do it;

    IF(ISNA(vlookup(......)),0,vlookup(....))
    Says "If the result of the lookup isn't found, put a zero in this cell, else return the
    target of the lookup".

    But;
    Are you getting a "N/A" or, as you put it, a "Ref!" - They're different.
    "N/A" means no value found (no "A" cars as per your question) whereas "REF!" means that
    you've stipulated a return column that exceeds the range of the table.
    Say your range is A1 to C3 (three columns) and your Vlookup says that on a match bring the
    value located in col 4 then you'll get the REF! error.
    Or you may be using a named range but have used another (non-existent) name in your
    statement.
    --
    Regards;
    Rob
    ------------------------------------------------------------------------
    "carlosgdlf" <[email protected]> wrote in message
    news:[email protected]...
    >
    > 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...o&userid=25821
    > View this thread: http://www.excelforum.com/showthread...hreadid=392717
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1