Why doesn't this work? I tried checking for whitespace, made sure length was the same, etc. Driving me nuts! I just want Alabama! The error given is "Value not available".
-
3the order of your column is wrong. The leftmost column must contain the value you are matching. what you are doing is looking for `AL` in the `State Name` column. of course, excel can't see it and thus returns `#N/A!`. – L42 Feb 07 '14 at 02:53
4 Answers
The usual solution is to apply =MATCH to find the row number in the array:
=MATCH(D1,B:B,0)
will search for the value in D1
in ColumnB (the last 0
means exactly) and hopefully return 2
(the second row in the chosen array - ie the whole of ColumnB). This can then be fed into:
=INDEX(A:A,MATCH(D1,B:B,0))
where it becomes the second row of ColumnA, ie Alabama
Details here =MATCH =INDEX and also http://www.excelhero.com/blog/2011/03/the-imposing-index.html

- 58,317
- 11
- 87
- 139
-
1
-
1I used to have a sticky note on my monitor that said `=index(range, row, column)` and `Match(what,row or column, 0 for exact or 1 for nearest)`. That helped internalise the syntax and wean me off Offset(). – teylyn Feb 07 '14 at 03:11
-
@pnuts there is no need to delete. As what Tim Williams said, having the same answer is not a waste but rather a way to show the OP that the presented solution is indeed true and correct. – L42 Feb 07 '14 at 03:13
The order of your column is wrong. The leftmost column must contain the value you are matching. What you are doing is looking for AL in the State Name column. Of course, excel can't see it and thus returns #N/A!
.
You can try this:
=INDEX($A:$A,MATCH(D1,$B:$B,0),1)
Hope this helps.

- 19,427
- 11
- 44
- 68
-
1+1, but also note that in a range with just one column or just one row, Index works fine without the third parameter. If the range is a column, just do =index(column, number). If the range is a row, then just do =index(row, number). The third parameter is only required in a range with several columns AND several rows. Then the second parameter specifies the row and the third parameter the column. – teylyn Feb 07 '14 at 03:05
-
@teylyn is right. The reason why i completed the syntax is for the OP to get a hang of the formula. :D btw, pnuts provided a complete explantion and link on how to use the functions. – L42 Feb 07 '14 at 03:07
The formula looks for "AL" in the first column specified (column A). It only finds "Alabama", so returns error.

- 2,054
- 4
- 31
- 46
-
I see. How would you suggest I get Alabama then without switching the columns around? I appreciate it. – atkayla Feb 07 '14 at 02:54
-
You can use a combination of `match` and `offset`. `match` finds the row of interest, and then you `offset` by that many rows. – Roberto Feb 07 '14 at 02:56
-
1
-
-
1see [THIS](http://www.decisionmodels.com/calcsecretsi.htm) in support on @pnuts statement. – L42 Feb 07 '14 at 03:19
-
interesting... something new to learn about Excel. Thanks for the feedback (and especially the link). – Roberto Feb 07 '14 at 03:23
It can be slightly easier, even:
=INDEX(A:A,MATCH(D1,B:B))

- 2,656
- 27
- 27
-
Agreed. To insist on exact match, then use =INDEX(A:A,MATCH(D1,B:B,0)) – unigeek Feb 07 '14 at 03:10