+ Reply to Thread
Results 1 to 12 of 12

Creating a date Sequence with the removal of the odds

  1. #1
    Registered User
    Join Date
    03-25-2015
    Location
    Egypt
    MS-Off Ver
    2013
    Posts
    5

    Creating a date Sequence with the removal of the odds

    Hello

    I'm doing some sorting but I can't figure out how to do so...

    I have about four columns

    The First column

    Is written like that

    1/1/2010 00:00:00
    1/1/2010 00:10:00
    1/1/2010 00:20:00
    1/1/2010 00:30:00
    1/1/2010 00:40:00
    1/1/2010 00:50:00
    1/1/2010 01:00:00
    1/1/2010 01:10:00
    1/1/2010 01:20:00
    1/1/2010 01:30:00
    1/1/2010 01:40:00
    1/1/2010 01:50:00
    1/1/2010 02:00:00
    1/1/2010 02:10:00
    1/1/2010 02:20:00
    1/1/2010 02:30:00
    1/1/2010 02:40:00
    1/1/2010 02:50:00
    ...
    ...

    2/1/2010 00:00:00
    2/1/2010 00:10:00
    2/1/2010 00:20:00
    2/1/2010 00:30:00
    2/1/2010 00:40:00
    2/1/2010 00:50:00
    2/1/2010 01:00:00
    2/1/2010 01:10:00
    2/1/2010 01:20:00
    2/1/2010 01:30:00
    2/1/2010 01:40:00
    2/1/2010 01:50:00
    2/1/2010 02:00:00
    2/1/2010 02:10:00
    2/1/2010 02:20:00
    2/1/2010 02:30:00
    2/1/2010 02:40:00
    2/1/2010 02:50:00

    and so on..

    Sometimes The machine is stop working and also stop recording to excel which will be like that

    1/1/2010 00:00:00
    1/1/2010 00:10:00
    1/1/2010 00:40:00
    1/1/2010 00:50:00
    1/1/2010 01:00:00
    1/1/2010 01:10:00
    1/1/2010 01:20:00
    1/1/2010 01:30:00
    1/1/2010 01:40:00
    1/1/2010 01:50:00

    all I need to put a code that deletes all rows that it's group is not complete like
    1/1/2010 00:00:00
    1/1/2010 00:10:00
    1/1/2010 00:40:00
    1/1/2010 00:50:00

    1/1/2010 01:00:00
    1/1/2010 01:10:00
    1/1/2010 01:20:00
    1/1/2010 01:30:00
    1/1/2010 01:40:00
    1/1/2010 01:50:00

    which will leave only these rows
    1/1/2010 01:00:00
    1/1/2010 01:10:00
    1/1/2010 01:20:00
    1/1/2010 01:30:00
    1/1/2010 01:40:00
    1/1/2010 01:50:00
    Last edited by Mohamed7; 03-26-2015 at 06:51 AM.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Can you help me with this Excel

    (adjust the following formula to your range of data)

    So maybe out in your empty column (G1?) put:

    =IF(SUMPRODUCT((INT($A$1:$A$10)=INT(A1))*(LEFT(ROUND(($A$1:$A$10-INT($A$1:$A$10))*24,6))=LEFT(ROUND((A1-INT(A1))*24,6))))<>6,1/0,"") and copy down

    1. Then select G
    2. Hit F5
    3. Choose Special...
    4. Under Formulas uncheck Logical, Numbers, and Text (leaving only errors)
    5. Hit Okay

    1. Go to 'Cells' in Toolbar
    2. Expand Menu beneath Delete
    3. Choose Delete Sheet Rows

    Could also be adapted for VBA.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Can you help me with this Excel

    Hi, welcome to the forum

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem - not what you think the answer might be. (think google search terms?). Once you have done this please send me a PM and I will remove this request. (Also, include a link to your thread - copy from the address bar)

    Many members search our previous posts, and thread titles play a big part of the search. I doubt anybody would do a search based on your title?

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    03-25-2015
    Location
    Egypt
    MS-Off Ver
    2013
    Posts
    5

    Re: Creating a date Sequence with the removal of the odds

    Thank you @daffodil11 for your help

    I think your method is pretty good till now but I can't apply it ..and I don't know know why

    you better should have a look at the excel file .. I have sent the file and password to your inbox in two separate messages

    Thank you again

  5. #5
    Registered User
    Join Date
    08-15-2014
    Location
    St.Petersburg, Russia
    MS-Off Ver
    MSO Excel 2010
    Posts
    20

    Re: Creating a date Sequence with the removal of the odds

    If I understand you correctly, machine place six timestamps each hour (every 10 minutes) in excel file

    Let your data in column A, starting from 1st row: A1:A17, and there are no empty cells
    Then in next column place
    Please Login or Register  to view this content.
    and fill down.
    Then just filter all cells with FALSE in it, and delete rows

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Creating a date Sequence with the removal of the odds

    I'm sorry, but the corporate firewall prevents downloading files from p2p sites.

    Here's a workbook with your example and the steps.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-15-2014
    Location
    St.Petersburg, Russia
    MS-Off Ver
    MSO Excel 2010
    Posts
    20

    Re: Creating a date Sequence with the removal of the odds

    Oops, my mistake. My formula works intraday only

  8. #8
    Registered User
    Join Date
    03-25-2015
    Location
    Egypt
    MS-Off Ver
    2013
    Posts
    5

    Re: Creating a date Sequence with the removal of the odds

    @daffodil11
    I have tried the formula but it seems working sometimes and sometimes no

    I have attached the excel after removing important data so you can look at

    Thank you

    @hohlick

    Thank you for your help ..I appreciate that
    Attached Files Attached Files

  9. #9
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Creating a date Sequence with the removal of the odds

    I see. Instead, let's just blend my solution with hohlick.

    They were much closer to the answer, minus the same day criteria.

    C1 and copied down:
    =IF(SUMPRODUCT((INT($A$1:$A$8199)=INT(A1))*(HOUR($A$1:$A$8199)=HOUR(A1)))<>6,1/0,"")

  10. #10
    Registered User
    Join Date
    03-25-2015
    Location
    Egypt
    MS-Off Ver
    2013
    Posts
    5

    Re: Creating a date Sequence with the removal of the odds

    @daffodil11

    I love you, Man

    It really Works ..Thanks to you and To @hohlick Of course

    I have another question if you don't mind

    1- The machine is making these dates in a row
    1/1/2015 12:00:00 AM
    1/1/2015 12:10:00 AM
    1/1/2015 12:20:00 AM
    1/1/2015 12:30:00 AM
    1/1/2015 12:40:00 AM
    1/1/2015 12:50:00 AM

    is there anyway that I can

    1/1/2015 12:00:00 AM
    1/1/2015 01:00:00 AM
    1/1/2015 02:00:00 AM
    1/1/2015 03:00:00 AM
    1/1/2015 04:00:00 AM
    .......
    1/1/2015 11:00:00 AM
    2/1/2015 12:00:00 AM

    is there any way to do this sequence because I have tried and every time it goes wrong..the sequence between time and date doesn't unite .. I don't know why?!

  11. #11
    Registered User
    Join Date
    03-25-2015
    Location
    Egypt
    MS-Off Ver
    2013
    Posts
    5

    Re: Creating a date Sequence with the removal of the odds

    anything??!!!!!

  12. #12
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Creating a date Sequence with the removal of the odds

    I don't have Excel at home, but will gladly examine it on Monday.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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