View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Lookup returns unexpected result

Dear David

This should work. I have sorted the lookup elements

=LOOKUP(MatRoster!C8,{7,8,9,13,17,730,830,1330,143 0,2115,2130,2230,2245;"AM","AM","AM","PM","PM","AM ","AM","PM","PM","ND","ND","ND","ND"})


If this post helps click Yes
---------------
Jacob Skaria


"David Ryan" wrote:

Hi Guys its me again sorry. Below is the function and the results obtained. I
have changed the cell format to all sorts with no effect.

Hope someone can help. Happy to email the spreadsheet if that will help, no
laughing at my probable poor formulas.

=IFERROR(LOOKUP('MatRoster'!C7,{7,730,8,830,9,13,1 330,1430,17,2115,2130,2230,2245},{"AM","AM","AM"," AM","AM","PM","PM","PM","PM","ND","ND","ND","ND"}) ,0)

7 Returns AM
730 Returns PM should be AM
8 Returns AM
830 Returns PM should be PM
9 Returns AM
13 Returns PM
1330 Returns PM
1430 Returns PM
17 Returns PM
2115 Returns PM
2130 Returns ND
2230 Returns ND
2245 Returns ND