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".
相关问题
- Excel sunburst chart: Some labels missing
- Error handling only works once
- Excel formula in VBA code
- Excel VBA run time error 450 from referencing a ra
- DoCmd.TransferSpreadsheet is not recognizing works
相关文章
- Get column data by Column name and sheet name
- programmatically excel cells to be auto fit width
- Unregister a XLL in Excel (VBA)
- How to prevent excel from truncating numbers in a
- numeric up down control in vba
- Declare a Range relative to the Active Cell with V
- What's the easiest way to create an Excel tabl
- How to create a hyperlink to a different Excel she
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:
Hope this helps.
The formula looks for "AL" in the first column specified (column A). It only finds "Alabama", so returns error.
It can be slightly easier, even:
The usual solution is to apply =MATCH to find the row number in the array:
will search for the value in
D1
in ColumnB (the last0
means exactly) and hopefully return2
(the second row in the chosen array - ie the whole of ColumnB). This can then be fed into: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