+ Reply to Thread
Results 1 to 6 of 6

CharAt command in excel

  1. #1
    Forum Contributor
    Join Date
    09-02-2005
    Posts
    146

    CharAt command in excel

    Is there any "CharAt" command in Excel similar to the "CharAt" function in Java?

    I'm currently getting data from a program that doesn't know how to tell time.

    Normally, time is given in a hh:mm:ss:## format. So if something happened at 12:08:15:20. The program that I'm using is truncating the leading zero off of values less than 10. So the example time above would display as:
    12:8:15:20

    What I'm hoping to do is find the best way to go thru and find the location of each ":" so I can break the time up into its components "12" "8" "15" and "20" then put them back together in the correct format.

    I've been unable to find a CharAt function, so right now I'm thinking the only way to do this is a bunch of nested If(right(left(<cell>,i),1)=":"....)

    Anyone have any ideas?

    P.S. I didn't write the program that is giving the bad time values. The company that made that software is working on the problem, but I don't want to sit on my hands waiting for them to fix it.

  2. #2
    Registered User
    Join Date
    10-25-2006
    Posts
    54
    I don't know the CharAt command but you could use Text to Columns from the data menu and use the colon as a delimiter?

    Maybe too restrictive as I don't know if you could use it withon a routine but just a thought.

    A

  3. #3
    Forum Contributor
    Join Date
    09-02-2005
    Posts
    146
    Well, it's not the most eliquent solution... but it's better than what I was doing and it should hold me over until they are able to fix their program.

    Thanks!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Are there really three colons in the format, or is the last actually a decimal point?

  5. #5
    Forum Contributor
    Join Date
    09-02-2005
    Posts
    146
    It's really all colons. Attached is a copy of what the program outputs.

    I have a program that takes care of the data, just need to change the time formats to a standard time. (I.E. 12:7:35:20 -> 12:07:35:20)
    Attached Files Attached Files

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    That was my point: hh:mm:ss:## is not a valid format, at least in my version of Excel. hh:mm:ss.ss is.

+ 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. Replies: 1
    Last Post: 03-12-2008, 09:14 AM
  2. Filter external data based on value in Excel?
    By obiwaynekenobi in forum Excel General
    Replies: 1
    Last Post: 01-24-2008, 11:55 PM
  3. Excel Macro - Read excel & read excel range - save as text
    By se.sathish in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2008, 09:00 AM
  4. new instance Excel application
    By extreme in forum Excel General
    Replies: 3
    Last Post: 06-25-2007, 12:41 AM
  5. how to merge data from one excel into another excel
    By refreshplease3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2006, 08:51 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