views:

21

answers:

1

I have a cell that takes the time value from another cell. I want to include an addition of this time as well as a dash '-' to format the time into a sort of schedule.

Example:

userinput cell: 5:00 AM

Formated cell (how I would like it to look): 5:00 AM - 3:30 PM

What would the function be to get something like this?

+1  A: 

Unfortunately, you'll have to specify the format of the time explicitly. To output the string based on cells A1 and B1, use

=CONCATENATE(TEXT(A1;"h:mm AM/PM");" - ";TEXT(B1;"h:mm AM/PM"))

Formatted in a more visual way, that looks like

=CONCATENATE(         <--- puts arguments together
    TEXT(             <--- formats a value
        A1;           <--- value to format
        "h:mm AM/PM"  <--- format
    );
    " - ";            <--- dash in the middle
    TEXT(             <--- formats a value
        B1;           <--- value to format
        "h:mm AM/PM"  <--- format
    )
);
MvanGeest
I tried to do this but it just says that it contains an error. I substituted it for my cells too. =CONCATENATE(TEXT(time;"h:mm AM/PM");" - ";TEXT(time;"h:mm AM/PM"))
BioXhazard
You input a cell reference instead of `time`? No idea. Works for me on Excel 2003, and I don't suppose it's any different in 2007. What is the error? Which part is highlighted?
MvanGeest
BioXhazard
I also have another question. Is there a way I can increase the second time by 10 hours and 30 minutes?
BioXhazard
MvanGeest
Oh wait, maybe it's your locale setting. Annoying.
MvanGeest
Yes, you can do `A1+TIME(10,30,0)` to accomplish that (this is a guess based on the previous result!)
MvanGeest
It's Excel 2003. And yeah, maybe it is. Not sure.Do you know the answer to my second question?
BioXhazard
Okay, thanks a lot.
BioXhazard
Thank you for upvoting my post. My comments, however, don't give me or you any reputation, so please vote them up only if they're really helpful/crucial. I think that's what the function is intended for. Happy scheduling :)
MvanGeest
Haha, I just thought I'd rate them up for you since they were helpful to me. Thanks!
BioXhazard