+ Reply to Thread
Results 1 to 7 of 7

HELP - Date Range In 1 Cell Calculation

  1. #1
    Adam
    Guest

    HELP - Date Range In 1 Cell Calculation

    Hello,

    I have one cell where i enter a date 8/30/2005 (which resides in A3).

    And i need another cell to display a date range based on the above date.
    The date range will always be the same number of days apart. For example the
    date range will always be 2-7 days from the entered above date. What i did so
    far was 2 seperate calculations in 2 different cells. One for the low end
    (=SUM(A3+2) and one for the high end =SUM(A3+7). Then I put =(B3) & " " &
    "through" & " " & (C3) in the third cell where i want the range to appear.
    But what happens is it comes out like:
    38596 through 38599

    How can i get the dates to remain in date format even though there is text
    between them???




  2. #2
    Bob Phillips
    Guest

    Re: HELP - Date Range In 1 Cell Calculation

    No need for SUM

    =A3+2
    =A3+7

    =TEXT(B3,"m/d/yyy")&" through "&TEXT(C3,"m/d/yyyy")

    --
    HTH

    Bob Phillips

    "Adam" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    >
    > I have one cell where i enter a date 8/30/2005 (which resides in A3).
    >
    > And i need another cell to display a date range based on the above date.
    > The date range will always be the same number of days apart. For example

    the
    > date range will always be 2-7 days from the entered above date. What i did

    so
    > far was 2 seperate calculations in 2 different cells. One for the low end
    > (=SUM(A3+2) and one for the high end =SUM(A3+7). Then I put =(B3) & " " &
    > "through" & " " & (C3) in the third cell where i want the range to appear.
    > But what happens is it comes out like:
    > 38596 through 38599
    >
    > How can i get the dates to remain in date format even though there is text
    > between them???
    >
    >
    >




  3. #3
    Adam
    Guest

    Re: HELP - Date Range In 1 Cell Calculation

    Thanks Bob that worked great!

    I got one more question:
    What if my date range result lands on a weekend and i don't want it to?

    Is there a way that i can identify and check that that the result is a
    weekend and if it is move the range to the next earliest range?

    If possible please use my work email as well ([email protected]).

    Thanks.

    "Bob Phillips" wrote:

    > No need for SUM
    >
    > =A3+2
    > =A3+7
    >
    > =TEXT(B3,"m/d/yyy")&" through "&TEXT(C3,"m/d/yyyy")
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > "Adam" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello,
    > >
    > > I have one cell where i enter a date 8/30/2005 (which resides in A3).
    > >
    > > And i need another cell to display a date range based on the above date.
    > > The date range will always be the same number of days apart. For example

    > the
    > > date range will always be 2-7 days from the entered above date. What i did

    > so
    > > far was 2 seperate calculations in 2 different cells. One for the low end
    > > (=SUM(A3+2) and one for the high end =SUM(A3+7). Then I put =(B3) & " " &
    > > "through" & " " & (C3) in the third cell where i want the range to appear.
    > > But what happens is it comes out like:
    > > 38596 through 38599
    > >
    > > How can i get the dates to remain in date format even though there is text
    > > between them???
    > >
    > >
    > >

    >
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: HELP - Date Range In 1 Cell Calculation

    Now you know that you can <g>

    =TEXT(IF(WEEKDAY(B3,2)<6,B3,B3+(8-WEEKDAY(B3,2))),"m/d/yyy")&" through
    "&TEXT(IF(WEEKDAY(C3,2)<6,C3,C3+(8-WEEKDAY(C3,2))),"m/d/yyyy")

    --
    HTH

    Bob Phillips

    "Adam" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks Bob that worked great!
    >
    > I got one more question:
    > What if my date range result lands on a weekend and i don't want it to?
    >
    > Is there a way that i can identify and check that that the result is a
    > weekend and if it is move the range to the next earliest range?
    >
    > If possible please use my work email as well ([email protected]).
    >
    > Thanks.
    >
    > "Bob Phillips" wrote:
    >
    > > No need for SUM
    > >
    > > =A3+2
    > > =A3+7
    > >
    > > =TEXT(B3,"m/d/yyy")&" through "&TEXT(C3,"m/d/yyyy")
    > >
    > > --
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > "Adam" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hello,
    > > >
    > > > I have one cell where i enter a date 8/30/2005 (which resides in A3).
    > > >
    > > > And i need another cell to display a date range based on the above

    date.
    > > > The date range will always be the same number of days apart. For

    example
    > > the
    > > > date range will always be 2-7 days from the entered above date. What i

    did
    > > so
    > > > far was 2 seperate calculations in 2 different cells. One for the low

    end
    > > > (=SUM(A3+2) and one for the high end =SUM(A3+7). Then I put =(B3) & "

    " &
    > > > "through" & " " & (C3) in the third cell where i want the range to

    appear.
    > > > But what happens is it comes out like:
    > > > 38596 through 38599
    > > >
    > > > How can i get the dates to remain in date format even though there is

    text
    > > > between them???
    > > >
    > > >
    > > >

    > >
    > >
    > >




  5. #5
    Adam
    Guest

    Re: HELP - Date Range In 1 Cell Calculation

    Hello Bob,

    I used your earlier suggestion of not using the sum and did
    =TEXT(B3,"m/d/yyy")&" through "&TEXT(C3,"m/d/yyyy") instead.
    I just modified it a little to say:
    =TEXT(B3-7,"m/d/yyy")&" through "&TEXT(B3-2,"m/d/yyyy")
    This allowed me to use only one cell instead of 2.

    Then when you sent me the response to my "check and avoid the weekend"
    question the formula did not work. I think because the original solution was
    using 2 cells to figure out the range instead of 1 ex:
    =TEXT(B3,"m/d/yyy")&" through "&TEXT(C3,"m/d/yyyy")

    Is there any way to change
    =TEXT(IF(WEEKDAY(B3,2)<6,B3,B3+(8-WEEKDAY(B3,2))),"m/d/yyy")&" through
    > "&TEXT(IF(WEEKDAY(C3,2)<6,C3,C3+(8-WEEKDAY(C3,2))),"m/d/yyyy")


    to refer only to one cell. I'm trying only referenceing one cell but it is
    not working, I may be using the function wrong or fully understand how the
    arguments work???

    Help if possible..


    "Bob Phillips" wrote:

    > Now you know that you can <g>
    >
    > =TEXT(IF(WEEKDAY(B3,2)<6,B3,B3+(8-WEEKDAY(B3,2))),"m/d/yyy")&" through
    > "&TEXT(IF(WEEKDAY(C3,2)<6,C3,C3+(8-WEEKDAY(C3,2))),"m/d/yyyy")
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > "Adam" <[email protected]> wrote in message
    > news:[email protected]...
    > > Thanks Bob that worked great!
    > >
    > > I got one more question:
    > > What if my date range result lands on a weekend and i don't want it to?
    > >
    > > Is there a way that i can identify and check that that the result is a
    > > weekend and if it is move the range to the next earliest range?
    > >
    > > If possible please use my work email as well ([email protected]).
    > >
    > > Thanks.
    > >
    > > "Bob Phillips" wrote:
    > >
    > > > No need for SUM
    > > >
    > > > =A3+2
    > > > =A3+7
    > > >
    > > > =TEXT(B3,"m/d/yyy")&" through "&TEXT(C3,"m/d/yyyy")
    > > >
    > > > --
    > > > HTH
    > > >
    > > > Bob Phillips
    > > >
    > > > "Adam" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > Hello,
    > > > >
    > > > > I have one cell where i enter a date 8/30/2005 (which resides in A3).
    > > > >
    > > > > And i need another cell to display a date range based on the above

    > date.
    > > > > The date range will always be the same number of days apart. For

    > example
    > > > the
    > > > > date range will always be 2-7 days from the entered above date. What i

    > did
    > > > so
    > > > > far was 2 seperate calculations in 2 different cells. One for the low

    > end
    > > > > (=SUM(A3+2) and one for the high end =SUM(A3+7). Then I put =(B3) & "

    > " &
    > > > > "through" & " " & (C3) in the third cell where i want the range to

    > appear.
    > > > > But what happens is it comes out like:
    > > > > 38596 through 38599
    > > > >
    > > > > How can i get the dates to remain in date format even though there is

    > text
    > > > > between them???
    > > > >
    > > > >
    > > > >
    > > >
    > > >
    > > >

    >
    >
    >


  6. #6
    Bob Phillips
    Guest

    Re: HELP - Date Range In 1 Cell Calculation

    Hi Adam,

    How about this

    =TEXT(IF(WEEKDAY(A3+2,2)<6,A3+2,A3+2+(8-WEEKDAY(A3+2,2))),"m/d/yyy")&"
    through
    "&TEXT(IF(WEEKDAY(A3+7,2)<6,A3+7,A3+7+(8-WEEKDAY(A3+7,2))),"m/d/yyyy")

    --
    HTH

    Bob Phillips

    "Adam" <[email protected]> wrote in message
    news:[email protected]...
    > Hello Bob,
    >
    > I used your earlier suggestion of not using the sum and did
    > =TEXT(B3,"m/d/yyy")&" through "&TEXT(C3,"m/d/yyyy") instead.
    > I just modified it a little to say:
    > =TEXT(B3-7,"m/d/yyy")&" through "&TEXT(B3-2,"m/d/yyyy")
    > This allowed me to use only one cell instead of 2.
    >
    > Then when you sent me the response to my "check and avoid the weekend"
    > question the formula did not work. I think because the original solution

    was
    > using 2 cells to figure out the range instead of 1 ex:
    > =TEXT(B3,"m/d/yyy")&" through "&TEXT(C3,"m/d/yyyy")
    >
    > Is there any way to change
    > =TEXT(IF(WEEKDAY(B3,2)<6,B3,B3+(8-WEEKDAY(B3,2))),"m/d/yyy")&" through
    > > "&TEXT(IF(WEEKDAY(C3,2)<6,C3,C3+(8-WEEKDAY(C3,2))),"m/d/yyyy")

    >
    > to refer only to one cell. I'm trying only referenceing one cell but it is
    > not working, I may be using the function wrong or fully understand how the
    > arguments work???
    >
    > Help if possible..
    >
    >
    > "Bob Phillips" wrote:
    >
    > > Now you know that you can <g>
    > >
    > > =TEXT(IF(WEEKDAY(B3,2)<6,B3,B3+(8-WEEKDAY(B3,2))),"m/d/yyy")&" through
    > > "&TEXT(IF(WEEKDAY(C3,2)<6,C3,C3+(8-WEEKDAY(C3,2))),"m/d/yyyy")
    > >
    > > --
    > > HTH
    > >
    > > Bob Phillips
    > >
    > > "Adam" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Thanks Bob that worked great!
    > > >
    > > > I got one more question:
    > > > What if my date range result lands on a weekend and i don't want it

    to?
    > > >
    > > > Is there a way that i can identify and check that that the result is a
    > > > weekend and if it is move the range to the next earliest range?
    > > >
    > > > If possible please use my work email as well ([email protected]).
    > > >
    > > > Thanks.
    > > >
    > > > "Bob Phillips" wrote:
    > > >
    > > > > No need for SUM
    > > > >
    > > > > =A3+2
    > > > > =A3+7
    > > > >
    > > > > =TEXT(B3,"m/d/yyy")&" through "&TEXT(C3,"m/d/yyyy")
    > > > >
    > > > > --
    > > > > HTH
    > > > >
    > > > > Bob Phillips
    > > > >
    > > > > "Adam" <[email protected]> wrote in message
    > > > > news:[email protected]...
    > > > > > Hello,
    > > > > >
    > > > > > I have one cell where i enter a date 8/30/2005 (which resides in

    A3).
    > > > > >
    > > > > > And i need another cell to display a date range based on the above

    > > date.
    > > > > > The date range will always be the same number of days apart. For

    > > example
    > > > > the
    > > > > > date range will always be 2-7 days from the entered above date.

    What i
    > > did
    > > > > so
    > > > > > far was 2 seperate calculations in 2 different cells. One for the

    low
    > > end
    > > > > > (=SUM(A3+2) and one for the high end =SUM(A3+7). Then I put =(B3)

    & "
    > > " &
    > > > > > "through" & " " & (C3) in the third cell where i want the range to

    > > appear.
    > > > > > But what happens is it comes out like:
    > > > > > 38596 through 38599
    > > > > >
    > > > > > How can i get the dates to remain in date format even though there

    is
    > > text
    > > > > > between them???
    > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > > >

    > >
    > >
    > >




  7. #7
    Adam
    Guest

    Re: HELP - Date Range In 1 Cell Calculation

    This is working - at least to some extent...I'm trying to test it but i think
    i'm confusing myself. Sorry to be such a pain but let me give you this
    hypthetical situation and let me if the below formula would work because
    right not it's still giving me date ranges that include a weekend.

    My real life cell that I'm using is J30. I'm entering August 25th in there,
    but my range result is 8/18 - 8/23 which include the 20th and 21st (sat and
    sun). When i enter the 25th (or any date) and the range lands on a weekend
    like this example, i want to skip around it. I tried using 2-5 day range
    instead of 2-7 but it didn't help.
    It looks like its checking the range result but not moving it once it
    changes???

    "Bob Phillips" wrote:

    > Hi Adam,
    >
    > How about this
    >
    > =TEXT(IF(WEEKDAY(A3+2,2)<6,A3+2,A3+2+(8-WEEKDAY(A3+2,2))),"m/d/yyy")&"
    > through
    > "&TEXT(IF(WEEKDAY(A3+7,2)<6,A3+7,A3+7+(8-WEEKDAY(A3+7,2))),"m/d/yyyy")
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > "Adam" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello Bob,
    > >
    > > I used your earlier suggestion of not using the sum and did
    > > =TEXT(B3,"m/d/yyy")&" through "&TEXT(C3,"m/d/yyyy") instead.
    > > I just modified it a little to say:
    > > =TEXT(B3-7,"m/d/yyy")&" through "&TEXT(B3-2,"m/d/yyyy")
    > > This allowed me to use only one cell instead of 2.
    > >
    > > Then when you sent me the response to my "check and avoid the weekend"
    > > question the formula did not work. I think because the original solution

    > was
    > > using 2 cells to figure out the range instead of 1 ex:
    > > =TEXT(B3,"m/d/yyy")&" through "&TEXT(C3,"m/d/yyyy")
    > >
    > > Is there any way to change
    > > =TEXT(IF(WEEKDAY(B3,2)<6,B3,B3+(8-WEEKDAY(B3,2))),"m/d/yyy")&" through
    > > > "&TEXT(IF(WEEKDAY(C3,2)<6,C3,C3+(8-WEEKDAY(C3,2))),"m/d/yyyy")

    > >
    > > to refer only to one cell. I'm trying only referenceing one cell but it is
    > > not working, I may be using the function wrong or fully understand how the
    > > arguments work???
    > >
    > > Help if possible..
    > >
    > >
    > > "Bob Phillips" wrote:
    > >
    > > > Now you know that you can <g>
    > > >
    > > > =TEXT(IF(WEEKDAY(B3,2)<6,B3,B3+(8-WEEKDAY(B3,2))),"m/d/yyy")&" through
    > > > "&TEXT(IF(WEEKDAY(C3,2)<6,C3,C3+(8-WEEKDAY(C3,2))),"m/d/yyyy")
    > > >
    > > > --
    > > > HTH
    > > >
    > > > Bob Phillips
    > > >
    > > > "Adam" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > Thanks Bob that worked great!
    > > > >
    > > > > I got one more question:
    > > > > What if my date range result lands on a weekend and i don't want it

    > to?
    > > > >
    > > > > Is there a way that i can identify and check that that the result is a
    > > > > weekend and if it is move the range to the next earliest range?
    > > > >
    > > > > If possible please use my work email as well ([email protected]).
    > > > >
    > > > > Thanks.
    > > > >
    > > > > "Bob Phillips" wrote:
    > > > >
    > > > > > No need for SUM
    > > > > >
    > > > > > =A3+2
    > > > > > =A3+7
    > > > > >
    > > > > > =TEXT(B3,"m/d/yyy")&" through "&TEXT(C3,"m/d/yyyy")
    > > > > >
    > > > > > --
    > > > > > HTH
    > > > > >
    > > > > > Bob Phillips
    > > > > >
    > > > > > "Adam" <[email protected]> wrote in message
    > > > > > news:[email protected]...
    > > > > > > Hello,
    > > > > > >
    > > > > > > I have one cell where i enter a date 8/30/2005 (which resides in

    > A3).
    > > > > > >
    > > > > > > And i need another cell to display a date range based on the above
    > > > date.
    > > > > > > The date range will always be the same number of days apart. For
    > > > example
    > > > > > the
    > > > > > > date range will always be 2-7 days from the entered above date.

    > What i
    > > > did
    > > > > > so
    > > > > > > far was 2 seperate calculations in 2 different cells. One for the

    > low
    > > > end
    > > > > > > (=SUM(A3+2) and one for the high end =SUM(A3+7). Then I put =(B3)

    > & "
    > > > " &
    > > > > > > "through" & " " & (C3) in the third cell where i want the range to
    > > > appear.
    > > > > > > But what happens is it comes out like:
    > > > > > > 38596 through 38599
    > > > > > >
    > > > > > > How can i get the dates to remain in date format even though there

    > is
    > > > text
    > > > > > > between them???
    > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > >
    > > >
    > > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1