IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Excel Question
Can someone help me with an Excel programming problem? I would like move the 12 right most characters from one cell to another. Cell A contains "1/14/2003 1:02:14 PM" I would like to move " 1:02:14 PM" to cell B.

Does it make any difference if the .xls contains 6k records?

Thanks for your help.

Al Vitale
New If that's an actual time...
(rather than literal text) you can simply copy it to cell B and format it as you wish.


Peter
[link|http://www.ubuntulinux.org|Ubuntu Linux]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
New Enter in TargetCell: "=Right(SourceCell, 12)" HTH! (HTW :-)
New Will only work for string literals
Hence my suggestion to reformat :)


Peter
[link|http://www.ubuntulinux.org|Ubuntu Linux]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
New Al's question looks like string literals are what it's about
Expand Edited by CRConrad Feb. 22, 2005, 04:31:13 PM EST
New Looks like Excel's default rendition of a date/time serial


Peter
[link|http://www.ubuntulinux.org|Ubuntu Linux]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
New Default? On Yank Winders, perhaps, yes...
...but not on mine (and not on yours, I'd have thought), where the default *Windows* date and time formats -- which Excel obeys, AFAIK -- are different.

I mean, as long as you want to be *quite* exact about these things... (And people call *me* "anal"?!?)


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
New Al's Winders will be Yankish, I wot.


Peter
[link|http://www.ubuntulinux.org|Ubuntu Linux]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
New Quite possib -- hey, quite *probable*, even!
;-)
New And they'll all buffer overflow on 12/31/2024
New Why then; izzat when Al's Social Security runs out, or...?
New Use text->column
Tell it that the source is delimited by a space. You will get x/x/xxx then 1:11:11 then AM.

You need to have the 2 columns to the right open to accept the data from the split. Excel isn't smart enough to add the columns for this operation.
If you push something hard enough, it will fall over. Fudd's First Law of Opposition

[link|mailto:bepatient@aol.com|BePatient]
New People!
This string stuff won't work!

Dollars to donuts column A is a date/time value - i.e. a number.

Excel is formatting it mm/dd/yyyy HH:MM:SS PM

This is not a string you can do "left() right(), mid() etc" on. It's a NUMBER.

Of course, if it really is a string, then ignore me. But I bet it isn't.


Peter
[link|http://www.ubuntulinux.org|Ubuntu Linux]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
New Yep, yer probably right. Peculiar, though. I would have...
...thought that Excel would forcibly convert it to a string all by itself, and then taken the right-most sub-string of *that* -- it certainly does enough "helpful" stuff like that when you *don't* want it to, so why on Earth not now? Weirdski.


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
New If Peter is right, and that's a numeric date-time value...
...then enter into your target cell: "=SourceCell" (for instance, if your original value is in cell A 3, then enter: "=A3" into, say, B 3, or wherever you want the result to go).

And then format the target cell (B 3, or whatever, as per the above) to show only the time. The easiest (? IMO) way to do that is this: Right-click it, select "Format Cells..." from the pop-up menu (it's fourth from the bottom). In the "Format Cells" dialog[ue] that appears, select the (left-most) "Number" tab, and in the "Category" list box on the left, select "Time" (about half-way down on my system). In the "Type" list box on the right, there should be a value like "1:30:55 PM" (at the bottom, on my system); select that, click "OK", and you should be done.

(If you can't find that alternative, you can either futz around with the "Locale (location)" drop-down selector, or switch to the "Custom" category in the list box on the left. The correct Time-category selection seems to be equivalent to putting the value "[$-409]h:mm:ss AM/PM;@" into the "Type" edit line above the list box on the right. I'm not sure what the "[$-409]" and ";@" bits are all about; it seems to me that a simple "h:mm:ss AM/PM" does also work [but that could of course be just on my system].)

HTH!


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
New Correct
if its simply a format issue...copy the cell directly and change the format.

If you push something hard enough, it will fall over. Fudd's First Law of Opposition

[link|mailto:bepatient@aol.com|BePatient]
New /me falls over
You owe me a beer!

:-p


Peter
[link|http://www.ubuntulinux.org|Ubuntu Linux]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home]
Use P2P for legitimate purposes!
New Settle down fella
You'll get plenty of them in a couple months.
If you push something hard enough, it will fall over. Fudd's First Law of Opposition

[link|mailto:bepatient@aol.com|BePatient]
New Well, yes- but maybe he wants the original one *also*. (Al?)
Also, "=[Left-Arrow]" (or whatever) gives a neat and easy value to copy down into a lot of cells, if he actually has a whole column of values he wants to change(*). Oh well, a matter of taste, I suppose; YMMV.



(*): Get a correct value/format into the topmost one, Al, and then "paint" (i.e, multi-select) the rest of them by click-dragging with the mouse, or pressing shift-[Down-Arrow]; then finally press Ctrl-D.


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
New If you want a text result...
from date source you can use something similar to:
=TEXT(A1,"h:mm:ss AM/PM")

This seems to work from a text source as well as long as it's in the format you show.

but the easiest way as has been said, is to format the cells to show just the time
~~~)-Steven----

"I want you to remember that no bastard ever won a war by dying for his country.
He won it by making the other poor dumb bastard die for his country..."

General George S. Patton
New Thanks to all who contributed. I didn't respond to the
because the person who sent the data has not yet replied to me.

Thanks again everyone.

Al Vitale
     Excel Question - (alvitale) - (20)
         If that's an actual time... - (pwhysall)
         Enter in TargetCell: "=Right(SourceCell, 12)" HTH! (HTW :-) -NT - (CRConrad) - (8)
             Will only work for string literals - (pwhysall) - (7)
                 Al's question looks like string literals are what it's about -NT - (CRConrad) - (6)
                     Looks like Excel's default rendition of a date/time serial -NT - (pwhysall) - (5)
                         Default? On Yank Winders, perhaps, yes... - (CRConrad) - (4)
                             Al's Winders will be Yankish, I wot. -NT - (pwhysall) - (3)
                                 Quite possib -- hey, quite *probable*, even! -NT - (CRConrad) - (2)
                                     And they'll all buffer overflow on 12/31/2024 -NT - (ChrisR) - (1)
                                         Why then; izzat when Al's Social Security runs out, or...? -NT - (CRConrad)
         Use text->column - (bepatient) - (2)
             People! - (pwhysall) - (1)
                 Yep, yer probably right. Peculiar, though. I would have... - (CRConrad)
         If Peter is right, and that's a numeric date-time value... - (CRConrad) - (4)
             Correct - (bepatient) - (3)
                 /me falls over - (pwhysall) - (1)
                     Settle down fella - (bepatient)
                 Well, yes- but maybe he wants the original one *also*. (Al?) - (CRConrad)
         If you want a text result... - (Steven A S) - (1)
             Thanks to all who contributed. I didn't respond to the - (alvitale)

Did she think she was going to land in the back of a Pier 1 truck carrying papa-san chairs?
157 ms