LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 279
Default HMATCH star matching

In message .com of
Wed, 29 Aug 2007 06:43:40 in microsoft.public.excel.worksheet.functions,
Harlan Grove writes
"Peo Sjoblom" wrote...
Try either this

=VLOOKUP(Grade,{"A*",58;"A",52;"B",46;"C",40;"D" ,34;"E",28;
"F",22;"G",16;"U",0},2,0)

or this

=HLOOKUP(Grade,{"A*","A","B","C","D","E","F","G" ,"U";
58,52,46,40,34,28,22,16,0},2,0)

...

Picky: if Grade were A? both formulas would return 58; if Grade
were A~ both formulas would return 52; if Grade were just * both
formulas would return 58; if Grade were just ? both formulas would
return 52. If that doesn't matter to the OP, fine. However, if the OP
wants to kick out anything except the actual valid grades, then make
the 1st argument to the lookup functions

SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(Grade,"~","~~"), "*","~*"),"?","~?")


Thank you for being picky. I was so relieved that I could correctly
translate "A*" and "A" that I did not do full testing. I tried
=VLOOKUP(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(Grade,"~ ","~~"),"*","~*"),"?","~?"), ...

which works well apart from failure to distinguish "B" which is valid
and "b" which is not.


or use the array formula

=INDEX({58,52,46,40,34,28,22,16,0},
MATCH(TRUE,EXACT(Grade,{"A*","A","B","C","D","E", "F","G","U"}),0))


That returns the desired result
{58 ,52 ,#NA ,#NA} for
{"A*","A","A?","a"} and seems the best alternative to date.

Thank you very much.

I had missed the relevant documentation in the VLOOKUP help page.
--
Walter Briscoe
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
my mouse pointer is a star I want a plus aristaeus New Users to Excel 3 January 3rd 07 05:00 AM
Bob- you are a star! Dharsh Excel Discussion (Misc queries) 0 April 28th 05 01:18 PM
star shashi Excel Discussion (Misc queries) 2 April 3rd 05 04:26 PM
what does the star (*) indicate in an excel spreadsheet tim Excel Discussion (Misc queries) 2 March 30th 05 05:51 AM


All times are GMT +1. The time now is 03:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"