View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Inserting a value based on another value

Put this formula in O2...

=IF(A2="","",SEARCH(A2,"ABCDEHJKLMS"))

Note: You didn't say what you wanted to happen if A2 was not empty (or, as
you say, "null"), but also is not one of the letters you listed... the above
formula will generate a #VALUE! error for that condition.

--
Rick (MVP - Excel)


"AAbrams2008" wrote in message
...
I have a place where the value of A2 can be A,B,C,D,E,H,J,K,L,M,S, or null.
Based in the value entered in this cell, I want O2 to take the value of
Z2,Z3,Z4,Z5,Z6,Z7,Z8,Z9,Z10,Z11,Z12, or 0. I need to calculate this for
all
row values of the column O. It's too complex for a nested if/then loop,
so I
think I need to either insert a custom macro or embed a VB function,
however
both of these are things I don't have a lot of experience with. What do I
need to do?

Thanks!