+ Reply to Thread
Results 1 to 19 of 19

Way to Combine dates with in cell

  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Way to Combine dates with in cell

    I have a cell that is populated with dates from another sheet and sometimes these dates take up a lot of space is there a way to combine the dates with the range of the days is has.

    Ex. 9/01 9/03 9/04 9/05 9/06 9/07 9/08 9/09 9/10 9/11 9/12 9/13 9/14 9/15 9/16 9/17 9/18 9/19 9/20 9/21 9/22 9/23 9/24 9/25 9/26 9/27
    Can you make this 9/01 - 9/27 from formatting the cell a certain way or a way to only pick up the min & max day it see's.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Way to Combine dates with in cell

    Hi.

    Is the example you gave all contained within a single cell?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Combine dates with in cell

    Yes it is ...I can attach the sheet it comes from if that would help.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Way to Combine dates with in cell

    Try:

    =TRIM(LEFT(SUBSTITUTE(A1," ",REPT(" ",LEN(A1))),LEN(A1)))&" - "&TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",LEN(A1))),LEN(A1)))

    Regards

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Way to Combine dates with in cell

    Or this

    =LEFT(A1,FIND(" ",A1)-1)&" - "&TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",255)),255))
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Combine dates with in cell

    Here is the existing formula how would I combine it with it?

    =IF(OR(A10=""),"",'Daily Chgs'!BP60)

  7. #7
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Combine dates with in cell

    I used

    IF(OR(A10=""),"",LEFT('Daily Chgs'!BP60,FIND(" ",'Daily Chgs'!BP60)-1)&" - "&TRIM(RIGHT(SUBSTITUTE('Daily Chgs'!BP60," ",REPT(" ",255)),255)))

    The return answer is coming out as

    9/01 -

    I also used your version and entered the dates into cell a1 and the same return answer came through

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Way to Combine dates with in cell

    Maybe there is a space after 9/27, try to remove it.

    I have adjusted your formula to remove spaces:

    =IF(A10="","",LEFT('Daily Chgs'!BP60,FIND(" ",'Daily Chgs'!BP60)-1)&" - "&TRIM(RIGHT(SUBSTITUTE(TRIM('Daily Chgs'!BP60)," ",REPT(" ",255)),255)))
    Last edited by AlKey; 09-11-2014 at 05:53 PM.

  9. #9
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Combine dates with in cell

    There is no space after 9/27 but there are spaces between all the dates.

  10. #10
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Combine dates with in cell

    I have attached the sheet I am using If you look at the Daily Chgs Tab and look At each row for example E:3 thru BN:3 you have boxes to check if that service was used on that particular day. We want to have the dates of services used to be added to the Job Ticket Cell I:10 which corresponds with the service being provided during the Job.

    The dates are in E:1 thru BN:1

    I have tried several ways to accomplish this with not luck -- If you have to many days it wont combine days to help fit into the cell size and this is a invoice so we cant expand to show every day in the cell.

    If you have any ideas that would be great.
    Attached Files Attached Files

  11. #11
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Way to Combine dates with in cell

    Quote Originally Posted by bdouglas1011 View Post
    There is no space after 9/27 but there are spaces between all the dates.
    Please see attached spreadsheet.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Combine dates with in cell

    That formula you modified for me worked great thank you ....I may have to make an addition tomorrow ...but here is the question now.

    Say If I have dates:
    9/01 9/02 9/03 9/04 9/05
    then start back on

    9/10 9/11 9/12 9/13 9/14 9/15 9/16 9/17 9/18 9/19 9/20 9/21 9/22 9/23 9/24 9/25 9/26 9/27

    Can it return 9/01 -9/05 thru 9/10 - 9/27

    not sure if this is possible

  13. #13
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Combine dates with in cell

    I just copied down the formula to other rows and I noticed that some dates now Don't show the beginning part unless it started with 9/01 for tall the cells that start after 9/01 it only shows the last part ( - 9/06) Almost the opposite from before.


    here is the Formula in that cell:

    =IF(A17="","",LEFT('Daily Chgs'!BP67,FIND(" ",'Daily Chgs'!BP67)-1)&" - "&TRIM(RIGHT(SUBSTITUTE(TRIM('Daily Chgs'!BP67)," ",REPT(" ",255)),255)))

  14. #14
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Way to Combine dates with in cell

    Sorry, but without seeing the spreadsheet I can't really do much. If a formula is working on one cell and not with the other then the problem maybe with the whatever is in that cell.

  15. #15
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Way to Combine dates with in cell

    Try this

    Please Login or Register  to view this content.
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Combine dates with in cell

    I have attached the worksheet with that formula in it. I have carried it down the column and it works on some but on the ones
    that the date does not start on 9/01 it skips the start and just populates the end ( - 9/09) Just like it did earlier on the
    front end before I entered the revised formula of the one I posted. Maybe you can see something that would cause it.
    Attached Files Attached Files

  17. #17
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Combine dates with in cell

    I also entered the Code ...and the problem with it is when there was no service on a particular day and there is a gap with in the dates (By gap I men extra spaces) It returns a #value! until the extra spaces are taken out then it looks good. Not every day has an entry so the only way I knew to get the dates is to combine them together so it will give a space if no service on that day.

  18. #18
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Way to Combine dates with in cell

    Please see attached file. There were issues due to the merged cells (BP column) which is always a problem. You should avoid them whenever is possible and should NEVER use merged cells if they are to be referenced in formulas. Another adjustment I made is if there is only one date in BP column formula will display just that date.
    Attached Files Attached Files

  19. #19
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Combine dates with in cell

    That worked great Thanks.

    Now some people are asking me if possible to add .... lets say with a certain date range you had 31 days with in that range but there were 5 days with in that range that actually nothing happened.

    So in my charges I would have charged for 25 days but the range for the dates would still display say 9/01 - 10/1 the 31 day range from your list.

    Is it possible to have it group the date range only for the days actually used and show possibly 9/01 - 9/15 & 9/21 - 10/1

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Combine dates from two different cells into one cell
    By geiad in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-21-2013, 01:15 AM
  2. Replies: 11
    Last Post: 05-16-2013, 04:03 AM
  3. Combine tabs and add dates
    By mma3824 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-22-2013, 12:51 PM
  4. Reformat and combine data Across Dates
    By yunesm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2011, 02:07 PM
  5. How do I combine a list of dates & a value into 1 week intervals
    By Nathan Woodson in forum Excel General
    Replies: 0
    Last Post: 01-19-2006, 09:40 PM

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