Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 202
Default Text String Formula Q

I have the formula below that returns the string "Sales for w/e
19/10/08" - depending of course what the value Today()-1 is. How could
I modify that if Today()-1 is anything other than a Sunday value, it
would return the date of the previous Sunday to the one I am now in?
E.g. Today()-1 is 22/10/08 but I would want the date returned as
19/10/08

="Sales for w/e "&TEXT((TODAY()-1),"dd/mm/yy")
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Text String Formula Q

Give this a try...

="Sales for w/e "&TEXT(TODAY()-WEEKDAY(TODAY()-1),"dd/mm/yy")

--
Rick (MVP - Excel)


"Seanie" wrote in message
...
I have the formula below that returns the string "Sales for w/e
19/10/08" - depending of course what the value Today()-1 is. How could
I modify that if Today()-1 is anything other than a Sunday value, it
would return the date of the previous Sunday to the one I am now in?
E.g. Today()-1 is 22/10/08 but I would want the date returned as
19/10/08

="Sales for w/e "&TEXT((TODAY()-1),"dd/mm/yy")


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Text String Formula Q

Hi,

Try this

="Sales for w/e "&TEXT((TODAY()-WEEKDAY(TODAY())+1),"dd/mm/yy")

Mike

"Seanie" wrote:

I have the formula below that returns the string "Sales for w/e
19/10/08" - depending of course what the value Today()-1 is. How could
I modify that if Today()-1 is anything other than a Sunday value, it
would return the date of the previous Sunday to the one I am now in?
E.g. Today()-1 is 22/10/08 but I would want the date returned as
19/10/08

="Sales for w/e "&TEXT((TODAY()-1),"dd/mm/yy")

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Text String Formula Q

On Thu, 23 Oct 2008 01:12:35 -0700 (PDT), Seanie
wrote:

I have the formula below that returns the string "Sales for w/e
19/10/08" - depending of course what the value Today()-1 is. How could
I modify that if Today()-1 is anything other than a Sunday value, it
would return the date of the previous Sunday to the one I am now in?
E.g. Today()-1 is 22/10/08 but I would want the date returned as
19/10/08

="Sales for w/e "&TEXT((TODAY()-1),"dd/mm/yy")


A general formula would be:

=A1+1-WEEKDAY(A1)

So, in your string, substitute for A1, TODAY()-1.

e.g.

="Sales for w/e "&TEXT((TODAY()-WEEKDAY(TODAY()-1)),"dd/mm/yy")

--ron
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 202
Default Text String Formula Q

Thanks Guys, I think Rick yours is the one that actually returns the
correct expected value

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting a formula into a text string Courie Excel Discussion (Misc queries) 8 April 28th 23 03:45 AM
Formula Text String: Formatting Text and Numbers? dj479794 Excel Discussion (Misc queries) 5 June 30th 07 12:19 AM
formula for text string Dinesh Excel Worksheet Functions 0 November 3rd 06 05:33 PM
find text in a string formula Todd Excel Worksheet Functions 5 June 2nd 06 04:12 AM
formula with text string redb Excel Discussion (Misc queries) 1 September 29th 05 10:51 AM


All times are GMT +1. The time now is 02:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"