Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JR
 
Posts: n/a
Default Help with looking the nearest Sunday

Hi,

I currently use this formula to populate teh nearest Friday to today:

=TEXT(A13+LOOKUP(WEEKDAY(A13),{1,2,3,4,5,6,7},{-2,-3,3,2,1,0,-1}),"mm/dd/yyyy")

How do I change the formula so that it will caluclate the nearest Sunday?

Thanks for the help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default Help with looking the nearest Sunday

=TEXT(A13+LOOKUP(WEEKDAY(A13),{1,2,3,4,5,6,7},{0,-1,-2,-3,3,2,1}),"mm/dd/yyyy")


--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com



"JR" wrote in message
...
Hi,

I currently use this formula to populate teh nearest Friday to today:

=TEXT(A13+LOOKUP(WEEKDAY(A13),{1,2,3,4,5,6,7},{-2,-3,3,2,1,0,-1}),"mm/dd/yyyy")

How do I change the formula so that it will caluclate the nearest Sunday?

Thanks for the help.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Help with looking the nearest Sunday

Try something like this:

=TEXT(A13+CHOOSE(WEEKDAY(A13,2),-1,-2,-3,3,2,1,0),"mm/dd/yyy")

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"JR" wrote:

Hi,

I currently use this formula to populate teh nearest Friday to today:

=TEXT(A13+LOOKUP(WEEKDAY(A13),{1,2,3,4,5,6,7},{-2,-3,3,2,1,0,-1}),"mm/dd/yyyy")

How do I change the formula so that it will caluclate the nearest Sunday?

Thanks for the help.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default Help with looking the nearest Sunday

On Fri, 7 Apr 2006 11:36:01 -0700, JR wrote:

Hi,

I currently use this formula to populate teh nearest Friday to today:

=TEXT(A13+LOOKUP(WEEKDAY(A13),{1,2,3,4,5,6,7},{-2,-3,3,2,1,0,-1}),"mm/dd/yyyy")

How do I change the formula so that it will caluclate the nearest Sunday?

Thanks for the help.



You could also use the formula:

=A1-WEEKDAY(A1)+1+7*(WEEKDAY(A1)4)

and format the cell as a date.


--ron
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Daniel.M
 
Posts: n/a
Default Help with looking the nearest Sunday

Hi,

For nearest Friday, you can use:
=A1+4-WEEKDAY(A1+5)

Also, for nearest Sunday
=A1+4-WEEKDAY(A1+3)

and format the cells as a date

Regards,

Daniel M.

"JR" wrote in message
...
Hi,

I currently use this formula to populate teh nearest Friday to today:

=TEXT(A13+LOOKUP(WEEKDAY(A13),{1,2,3,4,5,6,7},{-2,-3,3,2,1,0,-1}),"mm/dd/yyyy")

How do I change the formula so that it will caluclate the nearest Sunday?

Thanks for the help.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default Help with looking the nearest Sunday

On Sat, 8 Apr 2006 12:46:20 -0400, "Daniel.M"
wrote:

For nearest Friday, you can use:
=A1+4-WEEKDAY(A1+5)

Also, for nearest Sunday
=A1+4-WEEKDAY(A1+3)


Neat!
--ron
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Daniel.M
 
Posts: n/a
Default Help with looking the nearest Sunday

Thanks Ron.
Have a nice day. :-)

Daniel M.

"Ron Rosenfeld" wrote in message
...
On Sat, 8 Apr 2006 12:46:20 -0400, "Daniel.M"

wrote:

For nearest Friday, you can use:
=A1+4-WEEKDAY(A1+5)

Also, for nearest Sunday
=A1+4-WEEKDAY(A1+3)


Neat!
--ron



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
Need to Sum Mon-Sat each seven days; Average Sunday Robert Moore Excel Worksheet Functions 7 November 4th 05 10:20 AM
rounding to nearest hundred dollar in Excel Diane New Users to Excel 7 October 14th 05 04:25 PM
Rounding up to the nearest nickel jhangas Excel Discussion (Misc queries) 3 May 28th 05 12:41 AM
Date Calculations Bruce Excel Worksheet Functions 11 May 19th 05 01:09 AM
How do i round up a price to the nearest 5,10,15 etc pence Millsy Excel Worksheet Functions 1 May 18th 05 02:20 PM


All times are GMT +1. The time now is 05:52 PM.

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"