+ Reply to Thread
Results 1 to 4 of 4

What data format is this and help with an IF column

  1. #1
    Registered User
    Join Date
    06-24-2022
    Location
    Virginia
    MS-Off Ver
    Office 365
    Posts
    2

    What data format is this and help with an IF column

    First question: Question about what date format to use

    I imported a .csv file to jira and i need to find the difference between 2 dates. I keep getting invalid. I think its because I can't figure out the correct date format for dates in this format: 23/Jun/2022 04:38:13PM -0400

    What is the right format? I think it starts dd/mmm/yyyy h:mm:ss AM/PM , but what about the -0400 which is just a GMT adjustment. Or is it easier to just get rid of the -0400? its 0400 is each field. if so what is the fastest way to trim that out?



    My second question: i need a field that calculates off of another field.
    if a need is less than or equal to 1 , I need it to be transformed into an S, if its more than 1 or less than or equal to 24, I need an M, and if its more tahn 24, I need it to be transformed into an L? This is some kind of IF statement right?

    So if out is like this

    Column 1. Column 2
    .5 S
    2 M
    25 L

  2. #2
    Registered User
    Join Date
    01-17-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, & 2010 Beta
    Posts
    78

    Re: What data format is this and help with an IF column

    Hi, Mesosorry,
    Something like: =if(a2<=1,"S",if(a2<=24,"M","L"))
    Lotusman

  3. #3
    Registered User
    Join Date
    06-24-2022
    Location
    Virginia
    MS-Off Ver
    Office 365
    Posts
    2

    Re: What data format is this and help with an IF column

    Thank you. What is the date format for dates in this format or if its easier the date format without the +0400 if there is an easy way
    to trim this off. I need the correct date format so i can find the difference between two date/times in this format?

    23/Jun/2022 04:38:13PM -0400

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,803

    Re: What data format is this and help with an IF column

    Sorry I'm a little late to this one, but hopefully I can help some.

    I suspect that your example would come into Excel as a text string -- I don't think Excel will automatically recognize that as a date/time and convert to a number. I expect that most of the effort is reliably converting the text the correct date/time serial number. For the one example that you give, this worked for me to convert the text to a number.

    =DATEVALUE(LEFT(text,11)) had no trouble recognizing the date portion of the text string. However, I know that DATEVALUE() is sometimes wishy-washy in its implementation, but it is probably an easy first try. You will probably want to test on a good, representative sampling of date/time text to make sure it works reliably.

    =TIMEVALUE(MID(text,13,8)) had no trouble recognizing the 12 hour clock values. An IF() function can test for AM/PM and add 0.5 days to make sure you get the correct 24 hour clock time of day. =TIMEVALUE(MID(...))+IF(MID(text,21,2)="PM",0.5,0). Assuming I understand the time stamp text, summing these two steps should give you the correct GMT/UTC date/time for the time stamp.

    Assuming the rightmost characters are a time zone correction to GMT/UTC, then it should be a simple matter of converting that part of the text to decimal hours, then convert to days and add the result to the above. =CONVERT(RIGHT(text,5)/100,"hr","day"). I am assuming that all time zone corrections are integer hours (+/-xx00) and there are no (+/-xx30) entries, as those will require another layer to deal with the fractional hour. Summing all three parts will give the correct time stamp for the specified time zone.

    Once you have the time text converted to the correct date/time serial number, then you should have no trouble adding, subtracting, or otherwise manipulating the date/time values.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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: 07-31-2018, 05:53 AM
  2. [SOLVED] Populate data in column format
    By cmokasak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-21-2016, 10:08 AM
  3. [SOLVED] Searching a column of time data in the given format(ex: 12/8/2015 9:30:53 AM) for data pt
    By acopp24 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-28-2015, 04:56 PM
  4. Joined Data To CSV Format (1 column)
    By Jhon Mustofa in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-27-2014, 10:37 PM
  5. Macro need Arranging column data in Quiz format using transpose and Text to Column Feature
    By successramesh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2014, 02:58 AM
  6. Transposing Data from Row to 2 Column format
    By cwc12 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-11-2011, 05:47 AM
  7. Format Column data to be Col and Row
    By techissue2008 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-18-2008, 02:20 AM

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