View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Who can help the NYPD with an Excel formula?

Just a couple of comments. First, you need to change your 21 to 20 in the
LOOKUP function (the OP's ranges were not all the same). Second, you have a
semi-colon in the FIND function that I think should be a comma. Third, I
would suggest using SEARCH instead of FIND so the user can use upper or
lower case letters in Column E as they wish. Implementing these makes your
formula this...

=LOOKUP(B2,{0,20,31,41,51},{0,1,2,3,4})+C2+3*(D2=" X")+
SEARCH(LEFT(E2&" ",1)," EDCBA")-1

One other thing I would suggest is to add a check to see if the row has a
name in Column A and, if not, output an empty string, like this...

=IF(A2="","",LOOKUP(B2,{0,20,31,41,51},{0,1,2,3,4} )+
C2+3*(D2="X")+SEARCH(LEFT(E2&" ",1)," EDCBA")-1)

This will allow the user to copy the formula down past the end of their
current data. With your original formula, copy it down past the end of the
current data will display 0's in Column E cells on the empty rows. Using the
modified formula, nothing will be displayed until entries are made in the
row; otherwise, the user will have to remember to copy the formula down
every time they enter a new row of data. (Note: I know you know this
Bernd... I wrote it for the benefit of the OP should they decide to use your
offering.)

--
Rick (MVP - Excel)


"Bernd P" wrote in message
...
Hello,

I suggest not to focus on a short, but on a maitainable solution for
somebody who is not too fluent with this kind of stuff:
=LOOKUP(B2,{0,21,31,41,51},{0,1,2,3,4})+C2+3*(D2=" X")+FIND(LEFT(E2&" ",
1);" EDCBA")-1

Regards,
Bernd