Consulting

Results 1 to 4 of 4

Thread: Solved: Making two cells date and placing them with a hyphen in a cell

  1. #1
    VBAX Tutor
    Joined
    Sep 2012
    Location
    London
    Posts
    237
    Location

    Solved: Making two cells date and placing them with a hyphen in a cell

    Hello to all
    stuck in a dilemma with two dates:
    problem:
    In cell C15 I have a date such as 23/02/2012, in another cell as W56 have another date 09/28/2013 in cell A76 I want to put two dates with a hyphen in the middle and say this: 23/02/2012 - 28/09/2013, but I do not get things right. The first problem is that if I format the cell to show the date can not change it because they recognize it as text. Do you have any ideas?
    Thank you in advance to all.

  2. #2
    VBAX Mentor
    Joined
    Jul 2012
    Posts
    398
    Location
    attach please a sample file with current data and desired result

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Quote Originally Posted by k0st4din
    In cell C15 I have a date such as 23/02/2012, in another cell as W56 have another date 09/28/2013
    This could be nigh on impossible for one reason only; could you confirm that these two dates have different formats. One, you say is 23/02/2012 which can only be dd/mm/yyyy
    and another 09/28/2013 which can only be mm/dd/yyyy. Is the date in C15 ALWAYS going to be dd/mm and that in W56 ALWAYS mm/dd? Or is this just some sort of typo?

    One more thing, are both these cells containing real Excel dates or just text strings?
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  4. #4
    VBAX Tutor
    Joined
    Sep 2012
    Location
    London
    Posts
    237
    Location
    Hello, after a long playing with formulas somehow managed to do what I do not know if it is right, but for me it works! Here is a solution that could help someone else!
    [vba]=TEXT(L25;"dd.mm.yyyy")&" - "&TEXT(W67;"dd.mm.yyyy")[/vba]Many thanks for your sympathy!
    Be still alive and well

Posting Permissions

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