ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   LOOKUP and #N/A Error (https://www.excelbanter.com/excel-worksheet-functions/126891-lookup-n-error.html)

Poody

LOOKUP and #N/A Error
 
I have a table of Values A5:B9. Column B contains schedules and Column A
contains the names of people that work the schedule/shifts from Column B.

If I use the formula:

=LOOKUP("6-4",B5:B9,A5:A9)

I get the #N/A error. B9 contains 6-4 and A9 contains Brian. If I change
the formula to:

=LOOKUP("6-4",B5:B11,A5:A11)

Everything works appropriately. Why do I need to add 2 additional rows to
my range? Rows 10 and 11 are blank and contain nothing in either column.

This is baffling and I would rather just use the exact range.

Any help would be appreciated.

Thanks,

Rich

Poody

LOOKUP and #N/A Error
 
That would explain things - thanks daddylonglegs! I appreciate it.

Rich

"daddylonglegs" wrote:

Hello Poody,

The LOOKUP formula probably wasn't appropriate for your problem because:

1) LOOKUP requires that the LOOKUP range (B5:B9) is sorted ascending. If
that isn't the case then you may get odd results

2) LOOKUP can return an "approximate match". I assume you don't want that.

Teethless Mama's suggestion avoids both problems, B5:B9 doesn't need to be
sorted and you'll only get a result if there is an exact match (otherwise
#N/A)

<snip


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com