Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between using True,False, 1,0 as the last value of a VLOOKUP in excel?

Tags:

excel

In excel, the vlookup function has an optional parameter at the end called [range lookup] or [not_exact_match]. You can input 1,0,true,or false for this value. What is the difference between these and how does it work?

like image 294
Brino Avatar asked Jan 09 '23 09:01

Brino


1 Answers

The last value in the formula is sometimes called Range Input;

Range_lookup - a logical value that specifies whether you want the VLookup method to find an exact match or an approximate match: Range Input will default to 'TRUE' if left blank.

You can use True,False, 1, or 0 in the formula for this value. All values are valid.

True is the same as 1, False is the same as 0.

TRUE or 1 [or blank which defaults to True]
The lookup range should normally be in ascending order from top to bottom.
Vlookup will return the last row where the range value is <= the lookup value.
If no rows meet this criteria then #N/A is returned.

FALSE or 0
The lookup range can be in any order.
Vlookup will return a value from the first row where the lookup value = range value.
If no rows meet this criteria then #N/A is returned.


Example:

0| RANGEA | RANGEB | LOOKUP_VALUE | VLOOKUP(..,2,TRUE)| VLOOKUP(..,2,FALSE)  
1|   1    |    A   |     0        |       #N/A        |      #N/A   
2|   3    |    B   |     2        |        A          |      #N/A    
3|   3    |    C   |     2        |        A          |      #N/A  
4|   5    |    D   |     5        |        E          |        D   
5|   5    |    E   |     5        |        E          |        D   
6|   7    |    F   |     8        |        G          |      #N/A  
7|   7    |    G   |     8        |        G          |      #N/A  
like image 169
Brino Avatar answered May 21 '23 22:05

Brino