+ Reply to Thread
Results 1 to 5 of 5

If Statement linked to cell with VLOOKUP problem - getting wrong v

Hybrid View

Guest If Statement linked to cell... 01-14-2006, 02:55 AM
Guest Re: If Statement linked to... 01-14-2006, 06:20 AM
Guest Re: If Statement linked to... 01-14-2006, 06:50 AM
Guest Re: If Statement linked to... 01-14-2006, 10:20 AM
Guest RE: If Statement linked to... 01-14-2006, 06:30 AM
  1. #1
    Mike R.
    Guest

    If Statement linked to cell with VLOOKUP problem - getting wrong v

    Hi,
    I have a simple IF statement that is =IF(A1>A2,A1,A2). The cell A1 is a
    VLOOKUP to get the value. This seems to be giving me a false answer in my If
    statement and it always equals the value in A1. If I just type in the value
    of A1 (to test it), the If statement works properly.... help.
    Mike

  2. #2
    Roger Govier
    Guest

    Re: If Statement linked to cell with VLOOKUP problem - getting wrong v

    Hi Mike

    The value returned from the Vlookup, may be displaying a value that is
    the same as A2, but is actually different e,g, the value might be
    2.000345 but with a 2 decimal format may be displaying 2.00
    Try =IF(INT(A1)>INT(A2),A1,A2)
    assuming that that level of precision is suitable for your purposes.

    --
    Regards

    Roger Govier


    "Mike R." <MikeR@discussions.microsoft.com> wrote in message
    news:917CD9AB-1053-45CF-AD67-970470C5E557@microsoft.com...
    > Hi,
    > I have a simple IF statement that is =IF(A1>A2,A1,A2). The cell A1 is
    > a
    > VLOOKUP to get the value. This seems to be giving me a false answer
    > in my If
    > statement and it always equals the value in A1. If I just type in the
    > value
    > of A1 (to test it), the If statement works properly.... help.
    > Mike




  3. #3
    Roger Govier
    Guest

    Re: If Statement linked to cell with VLOOKUP problem - getting wrong v

    I meant to add before sending, it may also be that the value returned
    from the Vlookup is text.
    In which case
    =IF(--(A1)>A2,A1,A2)
    the double unary minus -- in front of (A1) will coerce the text value to
    numeric.

    --
    Regards

    Roger Govier


    "Roger Govier" <roger@technologyNOSPAM4u.co.uk> wrote in message
    news:%23$vYhOPGGHA.1100@TK2MSFTNGP10.phx.gbl...
    > Hi Mike
    >
    > The value returned from the Vlookup, may be displaying a value that is
    > the same as A2, but is actually different e,g, the value might be
    > 2.000345 but with a 2 decimal format may be displaying 2.00
    > Try =IF(INT(A1)>INT(A2),A1,A2)
    > assuming that that level of precision is suitable for your purposes.
    >
    > --
    > Regards
    >
    > Roger Govier
    >
    >
    > "Mike R." <MikeR@discussions.microsoft.com> wrote in message
    > news:917CD9AB-1053-45CF-AD67-970470C5E557@microsoft.com...
    >> Hi,
    >> I have a simple IF statement that is =IF(A1>A2,A1,A2). The cell A1
    >> is a
    >> VLOOKUP to get the value. This seems to be giving me a false answer
    >> in my If
    >> statement and it always equals the value in A1. If I just type in
    >> the value
    >> of A1 (to test it), the If statement works properly.... help.
    >> Mike

    >
    >




  4. #4
    Mike R.
    Guest

    Re: If Statement linked to cell with VLOOKUP problem - getting wro

    Roger, this is perfect. Thank you for teaching me something new!
    Mike

    "Roger Govier" wrote:

    > I meant to add before sending, it may also be that the value returned
    > from the Vlookup is text.
    > In which case
    > =IF(--(A1)>A2,A1,A2)
    > the double unary minus -- in front of (A1) will coerce the text value to
    > numeric.
    >
    > --
    > Regards
    >
    > Roger Govier
    >
    >
    > "Roger Govier" <roger@technologyNOSPAM4u.co.uk> wrote in message
    > news:%23$vYhOPGGHA.1100@TK2MSFTNGP10.phx.gbl...
    > > Hi Mike
    > >
    > > The value returned from the Vlookup, may be displaying a value that is
    > > the same as A2, but is actually different e,g, the value might be
    > > 2.000345 but with a 2 decimal format may be displaying 2.00
    > > Try =IF(INT(A1)>INT(A2),A1,A2)
    > > assuming that that level of precision is suitable for your purposes.
    > >
    > > --
    > > Regards
    > >
    > > Roger Govier
    > >
    > >
    > > "Mike R." <MikeR@discussions.microsoft.com> wrote in message
    > > news:917CD9AB-1053-45CF-AD67-970470C5E557@microsoft.com...
    > >> Hi,
    > >> I have a simple IF statement that is =IF(A1>A2,A1,A2). The cell A1
    > >> is a
    > >> VLOOKUP to get the value. This seems to be giving me a false answer
    > >> in my If
    > >> statement and it always equals the value in A1. If I just type in
    > >> the value
    > >> of A1 (to test it), the If statement works properly.... help.
    > >> Mike

    > >
    > >

    >
    >
    >


  5. #5
    paul
    Guest

    RE: If Statement linked to cell with VLOOKUP problem - getting wrong v

    VLOOKUP(lookup_value,table_array,col_index_num,range_lookup
    vlookup has four arguments and needs to be sorted for it to work properly
    unless you know you are looking for exact matches,then you use the "false"
    version

    Range_lookup A logical value that specifies whether you want VLOOKUP to
    find an exact match or an approximate match:

    If TRUE or omitted, an exact or approximate match is returned. If an exact
    match is not found, the next largest value that is less than lookup_value is
    returned.
    The values in the first column of table_array must be placed in ascending
    sort order; otherwise, VLOOKUP may not give the correct value. You can put
    the values in ascending order by choosing the Sort command from the Data menu
    and selecting Ascending. For more information, see Default sort orders.

    If FALSE, VLOOKUP will only find an exact match. In this case, the values in
    the first column of table_array do not need to be sorted. If there are two or
    more values in the first column of table_array that match the lookup_value,
    the first value found is used. If an exact match is not found, the error
    value #N/A is returned.
    Remarks

    --
    paul
    remove nospam for email addy!



    "Mike R." wrote:

    > Hi,
    > I have a simple IF statement that is =IF(A1>A2,A1,A2). The cell A1 is a
    > VLOOKUP to get the value. This seems to be giving me a false answer in my If
    > statement and it always equals the value in A1. If I just type in the value
    > of A1 (to test it), the If statement works properly.... help.
    > Mike


+ 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