Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old January 14th 06, 07:49 AM posted to microsoft.public.excel.worksheet.functions
Mike R.
 
Posts: n/a
Default If Statement linked to cell with VLOOKUP problem - getting wrong v

Hi,
I have a simple IF statement that is =IF(A1A2,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   Report Post  
Old January 14th 06, 11:16 AM posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default 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." wrote in message
...
Hi,
I have a simple IF statement that is =IF(A1A2,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   Report Post  
Old January 14th 06, 11:24 AM posted to microsoft.public.excel.worksheet.functions
paul
 
Posts: n/a
Default If Statement linked to cell with VLOOKUP problem - getting wrong v

VLOOKUP(lookup_value,table_array,col_index_num,ran ge_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(A1A2,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   Report Post  
Old January 14th 06, 11:44 AM posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default 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" wrote in message
...
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." wrote in message
...
Hi,
I have a simple IF statement that is =IF(A1A2,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   Report Post  
Old January 14th 06, 03:16 PM posted to microsoft.public.excel.worksheet.functions
Mike R.
 
Posts: n/a
Default 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" wrote in message
...
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." wrote in message
...
Hi,
I have a simple IF statement that is =IF(A1A2,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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making path of linked cell dynamic Negentropy Excel Discussion (Misc queries) 3 September 24th 05 09:02 PM
Using single cell reference as table array argument in Vlookup CornNiblet Excel Worksheet Functions 3 September 22nd 05 09:15 AM
Problem with formulas changing cell reference janicesweet Excel Discussion (Misc queries) 1 August 2nd 05 06:23 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
VLookup resulting in a blank cell... KempensBoerke Excel Worksheet Functions 1 October 28th 04 09:57 PM


All times are GMT +1. The time now is 01:10 PM.

Powered by vBulletin® Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright ©2004-2021 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017