ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Where is the bug in my array? (https://www.excelbanter.com/excel-discussion-misc-queries/6796-where-bug-my-array.html)

Gail Gurman

Where is the bug in my array?
 
I've created an array of grade values:

{"A+","A","A-","B+","B","B-","C+","C","C-","D+","D","D-","F";4.3,4,3.7,3.3,
3,2.7,2.3,2,1.7,1.3,1,0.7,0.5}

The problem is that when use LOOKUP to look for "C-", I get 2.7 (which is
the value for B-) when I should get 1.7. (I.e., LOOKUP("C-", Array) returns
2.7, where Array is the array above.)

Here is the same array, formatted in rows (all I did was copy and paste it
into Notepad and add spaces):

{"A+","A","A-","B+","B","B-","C+","C","C-","D+","D","D-","F";
4.3, 4, 3.7, 3.3, 3, 2.7, 2.3, 2, 1.7, 1.3, 1, 0.7, 0.5}

Can anyone see what is causing this error?

Thanks in advance!

Gail Gurman

Gail Gurman wrote in
:

I've created an array of grade values:

{"A+","A","A-","B+","B","B-","C+","C","C-","D+","D","D-","F";4.3,4,3.7,
3.3, 3,2.7,2.3,2,1.7,1.3,1,0.7,0.5}
The problem is that when use LOOKUP to look for "C-", I get 2.7 (which
is the value for B-) when I should get 1.7. (I.e., LOOKUP("C-", Array)
returns 2.7, where Array is the array above.)
Can anyone see what is causing this error?


Yet again, I solved my own problem. Turns out the elements in the first row
have to be in ascending order, so they have to be {"A","A-","A+",...}.


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

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