Excel Replacement Question

  • Thread starter Thread starter Harvey
  • Start date Start date
H

Harvey

Does anyone a fair amount of skill in Excel and can answer the following
if possible?

I want to be able to put fill a field with certain contents depending on
the value of another cell.

For example, one cell has the value "M", "T" or "W" and the cell that is
doing the checking with the formula replaces the text with either
"Monday", "Tuesday" or "Wednesday" in itself.

Also it is possible to show a small graphic in a cell depending on the
value of another cell?

I have tried using the "Substitute" command that seems to work with a
single instance of a replacment but cannot do this with multiple
possible values.

Thanks.
 
One way:

=LOOKUP(A1,{"M","T","W"},{"Monday","Tuesday","Wednesday"})

Lookups with larger arrays would better be done by listing the
arrays in a separate sheet and using VLOOKUP()

Pictures can't be inserted in cells - they reside on a top layer.
You can size them to match the cell size. Swapping pictures requires
some work with event macros. You can search the group archives at

http://google.com/advanced_group_search?q=group:*excel*

for some suggested ways.
 
If you build a table of your abbreviations and the long names (maybe a different
worksheet to keep it out of the way???)

I used sheet2, A1:B7 and put M,T,W,...Sa,Su (notice Saturday/Sunday) in A1:A7.
Then I put the long names in B1:B7

Then in that formula cell, you can put a formula like:

=if(a1="","",vlookup(a1,sheet2!$a$1:$b$7,2,false))

Showing pictures based on the value of a cell requires a macro.
 
You can use this,

=if(a1="M", "Monday")

You just compare a cell to a certain value, "M" in this example, and if the
comparision is true you set the cell to the value you want, in this example
"Monday".

Or if you want tto be really clever!!

=IF(A1="M","Monday",IF(A1="T","Tuesday",IF(A1="W","Wednesday",IF(A1="TH","Th
ursday",IF(A1="F","Friday")))))

Don't know about the graphic,
 
Back
Top