ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   week ending funciton (https://www.excelbanter.com/excel-worksheet-functions/216786-week-ending-funciton.html)

Dylan @ UAFC[_2_]

week ending funciton
 
I am needing a formula that will returna week ending date
based, this is primary way the data base needs to be sorted.

Or week ends on SAT

Glenn

week ending funciton
 
Dylan @ UAFC wrote:
I am needing a formula that will returna week ending date
based, this is primary way the data base needs to be sorted.

Or week ends on SAT



=A1-WEEKDAY(A1)+7

Mike H

week ending funciton
 
Hi,

If I understand correctly you want the next saturday from a date and if the
date is saturday and you want the folowing saturday change the middle 7 to 14

=A1+IF(WEEKDAY(A1)=7,7,7)-WEEKDAY(A1)

Mike

"Dylan @ UAFC" wrote:

I am needing a formula that will returna week ending date
based, this is primary way the data base needs to be sorted.

Or week ends on SAT


Rick Rothstein

week ending funciton
 
This... IF(WEEKDAY(A1)=7,7,7)... will always return 7... why not just use 7
and save the function calls?

a

--
Rick (MVP - Excel)


"Mike H" wrote in message
...
Hi,

If I understand correctly you want the next saturday from a date and if
the
date is saturday and you want the folowing saturday change the middle 7 to
14

=A1+IF(WEEKDAY(A1)=7,7,7)-WEEKDAY(A1)

Mike

"Dylan @ UAFC" wrote:

I am needing a formula that will returna week ending date
based, this is primary way the data base needs to be sorted.

Or week ends on SAT



Mike H

week ending funciton
 
Rick,

I wasn't sure what the OP wanted to do if the original date was a saturday
which is why I posted this because WEEKDAY(A1)=7,14,7)... returns the next
saturday. I pointed this out to the OP in my post

Mike

"Rick Rothstein" wrote:

This... IF(WEEKDAY(A1)=7,7,7)... will always return 7... why not just use 7
and save the function calls?

a

--
Rick (MVP - Excel)


"Mike H" wrote in message
...
Hi,

If I understand correctly you want the next saturday from a date and if
the
date is saturday and you want the folowing saturday change the middle 7 to
14

=A1+IF(WEEKDAY(A1)=7,7,7)-WEEKDAY(A1)

Mike

"Dylan @ UAFC" wrote:

I am needing a formula that will returna week ending date
based, this is primary way the data base needs to be sorted.

Or week ends on SAT




Ron Rosenfeld

week ending funciton
 
On Fri, 16 Jan 2009 11:09:01 -0800, Mike H
wrote:

Hi,

If I understand correctly you want the next saturday from a date and if the
date is saturday and you want the folowing saturday change the middle 7 to 14

=A1+IF(WEEKDAY(A1)=7,7,7)-WEEKDAY(A1)

Mike

"Dylan @ UAFC" wrote:

I am needing a formula that will returna week ending date
based, this is primary way the data base needs to be sorted.

Or week ends on SAT



More efficient might be:


Saturday does not advance
=A1+7-WEEKDAY(A1)

Saturday does advance
=A1+8-WEEKDAY(A1-6)

Only one function call instead of three.
--ron


All times are GMT +1. The time now is 12:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com