VLOOKUP Resulting in #REF - excel

I have the following set up in Excel, and I am attempting to lookup the first column in the range A5:A7, and return column 8 (the rate) plus the custom rate.
I am using the following thus far and it returns the #REF! error.
=G11+VLOOKUP(A11,$A$5:$A$7,8)
So for instance, to in row 11, I am trying to find the word Flash under the Type in the range A5:A7, and return the rate that it has (column #8 or H).
It should result in $0.26.
I am new to Excel, so any help is appreciated! :)

You should use this one instead:
=G11+VLOOKUP(A11,$A$5:$H$7,8,0)
Note, that I use $A$5:$H$7 intead $A$5:$A$7. Second change is to add 4th parameter equals to 0. When this parameter is FALSE or 0, VLOOKUP will only find an exact match. In this case, the values in the first column of $A$5:$H$7 do not need to be sorted. But when you ommit this parameter - VLOOKUP searches for exact/approximate match and values should be sorted.

Related

I have a column of alphanumeric data and would like to sum the values that are one row below the lookup value

I would like to return the sum of all values that are directly below a look up value "Pre173RB" in a single column.
First I used index and match but this is limited to only finding the first value "8".
=INDEX(B:B,MATCH(E1,B:B,0)+1,1)
I then attempted to incorporate the above formula into the repeating sequence below. The formula returned the first value in the column "30". The desired return is "18".
=INDEX(B:B, SMALL(IF(ISNUMBER(MATCH(E$1,B:B,0)+1), MATCH(ROW(B:B), ROW(B:B)), ""),ROWS(A$1:A1)))
I've attempted to use sumif in the above formula as well but errors return.
Any assistance is appreciated. I am probably complicating the formula.
=SUMIFS(B2:B26,B1:B25,E1)
Note that the sum range is offset one row versus the condition range.

Excel Vlookup table array is throwing NA error [duplicate]

"The range where the lookup value is located. Remember that the lookup value should always be in the first column in the range for VLOOKUP to work correctly. For example, if your lookup value is in cell C2 then your range should start with C."
But sometimes I want to be able to do dual-direction lookups. Ie, lookup using a key in column A to get the value in column B AND at the same time, in other formulas, lookup the value in B to get the value in A.
The only way I know is to add a column C which mirrors A, then use AB for the first lookup, and BC for the second lookup. But there has to be some cleaner solution. Is there some way to force VLOOKUP to use a different column other than the first one to find the key value, or is there a different function that would allow the equivalent?
As a side note, I am asking about Excel, but I actually use LibreOffice. Presumably the functions should be identical, but an answer that also works in LibreOffice would be preferable.
INDEX/MATCH will do it any direction of search.
So for your example of B --> A:
=INDEX(A:A,MATCH(yourCriteria,B:B,0))
The MATCH returns the row number of the match. The third Criterion of 0 is optional. The 0 is the same as FALSE for the forth criterion of VLOOKUP, in that it looks for an exact match.
The default is 1 with the data sorted it will return the match that is less than or equal to the criteria Like VLOOKUP's TRUE.
From that the INDEX finds and returns the correct value.
With the introduction of the Dynamic Array formula XLOOKUP we can use:
=XLOOKUP(yourCriteria,B:B,A:A,"",0)

INDEX MATCH on structured references / #value error

The use of INDEX / MATCH on 2 defined tables and a structured reference on their columns causes a #value error, although the function has been entered as an array-function.
Given:
**Table1:**
Key1|SourceVal
1|A
2|AA
**Table2:**
Key2|ValDisp
1|_{=INDEX(Table1;MATCH(Table2[#[Key2]];Table1[Key1];0);Table1[SourceVal])}_
The formula entered in column "ValDisp" effects in a #value error.
The formula analyzer shows, that the correct value is found, but is turned into #value during the last step.
INDEX can be invoked in two ways. In the way you are using it, first parameter is a range, and second and third parameters are numbers.
You are using =INDEX(Table1;MATCH(Table2[#[Key2]];Table1[Key1];0);Table1[SourceVal])
Last parameter Table1[SourceVal] does not return a number, so try to replace it with column number:
=INDEX(Table1;MATCH(Table2[#[Key2]];Table1[Key1];0);2)
Another option would be using a second MATCH that searchs for the name of the column and returns its position inside headers area of Table1. Something like this:
I got Excel 2007 so my structured references are different. Not # like in Excel 2010 and higher
You could replace the 2 by MATCH(Table1[[#HEADERS];[Sourceval]];Table1[#HEADERS];0)

INDEX MATCH Formula in Excel

I recently took over this spreadsheet from someone who left the company. Formula in T column:
=INDEX(BFTable, MATCH(1, (UPPER(LEFT(ST, 2))=$E$1:$E$315)*
(ProcessingDate>=$A$1:$A$315)*(ProcessingDate<=$B$1:$B$315)*
(EffectiveDate>=$C$1:$C$315)*(EffectiveDate<=$D$1:$D$315)*
($AI3=$P$1:$P$315)*($F$1:$F$315="HM"),0),COLUMN()-COLUMN($T$2)+1)
Could someone explain to me what this formula is trying to do? What is ST? The output is the same with processing date in A column. There is no BFTable, although the tab name is BF.
Thanks,
SC
The pieces BFTable and ST are probably named ranges.
What the formula does is look up in the range BFTable the row associated with the MATCH(...) part and the column given by COLUMN()-COLUMN($T$2)+1.
The MATCH section is a long conditional. It searches for the first case where all of the following conditions are true and returns the index of that row:
UPPER(LEFT(ST, 2))=$E$1:$E$315
ProcessingDate>=$A$1:$A$315
ProcessingDate<=$B$1:$B$315
EffectiveDate>=$C$1:$C$315
EffectiveDate<=$D$1:$D$315
$AI3=$P$1:$P$315
$F$1:$F$315="HM"
If they all return TRUE, then multiplying them together results in 1, but if any of them returns FALSE, then multiplying them results in 0, which won't match to 1 (the first argument of the MATCH function).

ms excel 2007, vlookup #n/a error

This question is an extension of this - click me:
So I have 7 ordered checkboxes, generating 128 possible combinations of being checked/unchecked. Each checkbox is linked to a cell showing its state - true =1, false =0.
I then have a cell that concatenates the states of all 7 check boxes into a 7 digit string, e.g. 1000011 or 0000000 or 1110011, etc - providing a lookup value for my lookup table (which designates each possible combination to a piece of text).
The problem I am having is that vlookup is not finding the strings beginning with a leading 1, e.g. 1000001, or 1110000, or 1001110, etc, but strangely is matching one of the strings beginning with a leading 1 - "10000000". In other words, when I select only the first check box of the 7, I get text. When I select the first check box in addition to any combination of the other 6, I get an #N/A. When I deselect the first check box, with any combination of the others, I get text. Odd, I know.
Could anyone help with this?
Thanks in advance.
You might check if format at origin is equal to all values at destination, I mean, if you have for example 1000001 in lookup field as NUMBER and at lookup table you have the same value as TEXT, VLOOKUP never going to find it, because to Excel is not the same thing a value as NUMBER and a value as TEXT.
I'm almost sure that in your lookup table you have some values as NUMBER; to solve it you have to select only the column of your lookup table when you have all the possible combinations, then go to Data -> Text To Columns, then click Next -> Next -> Choose 'Text' Option -> Finish
Let us know if that worked for you.
Short answer: Supply FALSE as 4th VLOOKUP() parameter.
If it is omitted, range search is supposed to be TRUE and in such a case order of items in VLOOKUP() list matters, because they are understood as thresholds, not as singular values.
From VLOOKUP() help:
Lookup_value The value to search in the first column of the table array. Lookup_value can be a value or a reference. If
lookup_value is smaller than the smallest value in the first
column of table_array, VLOOKUP returns the #N/A error value.
And now read carefully:
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.

Resources