How to add text, i.e., " -- Week: _________" to the formula in this message?

  • Thread starter Thread starter StargateFanFromWork
  • Start date Start date
S

StargateFanFromWork

Because of a unique but complicated requirement, custom formatting a cell
with
yyyy" -- Week: _________"
didn't work anymore. But I fixed it by using this in the cell formula
instead:
=IF(A2<>"",TEXT($A$2,"yyyy"),"")
(I was getting #VALUE! before I did this change above due to special formula
requirements which this group helped out with over the weekend).
This formula above gives me:
"2007".

Instead of just the year, i.e., "2007", how can I change the formula from
the just "2007" to display the year _and_ some text instead:
2007 -- Week: _________
where the year is achieved through "yyyy" on A2, etc.?

I tried all sorts of wacky things along the line of
=IF(A2<>"",TEXT($A$2,"yyyy" & " -- Week: _________"),"")
but, naturally, no luck no matter what I tried :(. Thanks. Blunderwoman
still blundering around with this one <g>.
 
Try this:

=IF(A2<>"",TEXT($A$2,"yyyy")&" -- Week: _________","")

Hope this helps.

Beautiful! Sure does, Pete. I just created a new spreadsheet in my
TIPS folder with all the date formatting tricks for the formula and
cell format that I've ever needed. This sheet now must cover just
about every situation I've ever needed re dates dependent on a
different cell.

Thanks. :oD
 
Glad to hear that, and thanks for feeding back. You could, of course,
put any text string before or after the TEXT function and join them
with &.

Pete
 
Glad to hear that, and thanks for feeding back. You could, of course,
put any text string before or after the TEXT function and join them
with &.

Thanks, yes. Once I saw what else was needed with the commas and
quotations marks. That's where I was going wrong, not knowing what
went where, I think. I had funn playing around with this format and
did up several different kinds of date and text string examples in my
examples sheet, both with and without things like addition.

Cheers. :oD
 
You're welcome.

Pete

Thanks, yes. Once I saw what else was needed with the commas and
quotations marks. That's where I was going wrong, not knowing what
went where, I think. I had funn playing around with this format and
did up several different kinds of date and text string examples in my
examples sheet, both with and without things like addition.

Cheers. :oD




- Show quoted text -
 
Back
Top