Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How combine dates in a cell

Posted on 2011-03-16
15
Medium Priority
?
362 Views
Last Modified: 2013-11-05
I have 4 cells for examlpe that have dates in them like...
6/14/2011      6/15/2011      6/16/2011      6/17/2011

In a 5th cell I want to use the 1st cell from above and the last cell from above and make it say...

"6/14/2011 - 6/17/2011"  (without the quote marks).

How can I do this?

--Steve
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +4
15 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35152435
=A1+" - "+D1

Kevin
0
 
LVL 39

Expert Comment

by:nutsch
ID: 35152440
Assuming your dates are in a1 through D1
=text(a1,"mm/dd/yyy") & " - " & text(d1,"mm/dd/yyy")

Thomas
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35152449
Sorry, I'm working in C# right now ;-)

=A1&" - "&D1

Kevin
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35152456
I also just realize that the date format in the source cell is NOT copied so use Thomas's solution.

Kevin
0
 

Author Comment

by:SteveL13
ID: 35152465
None of these work so far.
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 35152478
Did you try Thomas's solution? It works at my house.

Make sure the cell references match your own.

Kevin
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 35152496
=MONTH(A1)&"/" & DAY(A1)&"/"&YEAR(A1) & " - " & MONTH(D1)&"/" & DAY(D1)&"/"&YEAR(D1)
0
 
LVL 39

Expert Comment

by:nutsch
ID: 35152497
see attached file for use in action:

Thomas
datefile.xls
0
 
LVL 3

Expert Comment

by:ssisworo
ID: 35152932
TRY This :
 
= CONCATENATE(TEXT(A1,"m/d/yyyy")," - ",TEXT(D1,"m/d/yyyy"))

 preview
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 35153203
Steve, what message do you get when you try nutsch's proposed solution? (or the others)?
0
 

Author Comment

by:SteveL13
ID: 35155707
So far nothing has worked.  Just for reference my cells are D4 and G4.  I've altered the suggestions accordingly.  The error I get is #Value!

One other comment... the cell I'm putting these attempted formulas into is a merged "bunch" of cells from D23 to G23.  I don't know if that matters or not.

????
0
 

Author Comment

by:SteveL13
ID: 35157258
I think I have found a clue but still don't know what to do about it.  The problem is, cells D4 and G4 are formula cells like....   =WORKDAY(E4, -1, Holidays)

0
 
LVL 22

Expert Comment

by:rspahitz
ID: 35157451
just as a test, try this: set H4 formula to =G4

If that works, try =D4; if that works, try =D4&G4

If you don't get a date or number, your problem is in the original cells.

BTW  =D4&G4    should always work (to give you something that's not an error) if you see non-error values in D4 and H4 so that would indicate to me that you might be using the wrong symbol or (if copying) that you are copying something that is collecting some hidden "garbage".
0
 
LVL 45

Expert Comment

by:patrickab
ID: 35161474
if tht dates are in one cell in one long string, just use. ALT+Enter betweeen each pair of dates.
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 2000 total points
ID: 35161783
Hello Steve, it shouldn't matter whether the dates are just input or returned by a formula

If WORKDAY function gives the dates then they must be real dates so TEXT function should work. I used this formula in a merged cell and it worked fine

=TEXT(D4,"m/d/yyyy")&" - "&TEXT(G4,"m/d/yyyy")

If that doesn't work for you then it may be because of regional variations in the TEXT function, do you have non US regional settings? If so then you might have to adjust the "m/d/yyyy" part in the TEXT function to account for language differences....otherwise this workaround should work whatever your regional settings:

=MONTH(D4)&"/"&DAY(D4)&"/"&YEAR(D4)&" - "&MONTH(G4)&"/"&DAY(G4)&"/"&YEAR(G4)

regards, barry
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question