+ Reply to Thread
Results 1 to 19 of 19

Flagging a Column if timestamp occurs within a specified timestamp of another column.

  1. #1
    Registered User
    Join Date
    07-25-2012
    Location
    Boynton Beach
    MS-Off Ver
    Excel 2007
    Posts
    19

    Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Hello,

    I am looking to do the following:

    I have the following 4 Columns. I need to flag all column D timestamps that occur up to 30 minutes after column B. I can concat Column A and B together and C and D together if that makes things simpler.

    Column A Column B Column C Column D
    Date Time Date Time
    Oct-2 10:39:12 AM Oct-2 10:59:12 AM
    Last edited by Joe Butch; 02-24-2014 at 06:13 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Hi,

    Check out the conditional formatting that I have used in Column D in the attachment.

    Hope this helps

  3. #3
    Registered User
    Join Date
    07-25-2012
    Location
    Boynton Beach
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    This is good except for one issue that I should have specified before.

    There could be 500 rows of Column A and B and only 100 rows of column C and D. The flagging of column D needs to be done if the timestamp occurs anywhere in the column of B (with column A date taken into account)

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Can you post your workbook? Your description raises more questions than it answers.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Registered User
    Join Date
    07-25-2012
    Location
    Boynton Beach
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Sure. Thanks again I really do appreciate the help.

    To step back. Basically what I'm trying to do is multi-channel attribution of television commercial to an actual lead submitted on the website. Column A+B is the time the television commercial ran. Column b+c is the time the lead was submitted on the website.

    The 30 minute flag is the time i'm allowing for the attribution to count to the television commercial

    data-sample.xlsx

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    The first time in your example yields a negative time .... not possible so I changed it to something reasonable.

    Thinking that there was something wrong with your data, I copied it over into my own workbook. There was only 1 time that was 30 minutes or less. I changed another time so that the duration was less than 30 minutes and it appears to work.

    Play around with the uploaded file to see if it meets your needs.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-25-2012
    Location
    Boynton Beach
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Quote Originally Posted by newdoverman View Post
    The first time in your example yields a negative time .... not possible so I changed it to something reasonable.

    Thinking that there was something wrong with your data, I copied it over into my own workbook. There was only 1 time that was 30 minutes or less. I changed another time so that the duration was less than 30 minutes and it appears to work.

    Play around with the uploaded file to see if it meets your needs.
    Thanks. unfortunately this doesn't work. The reason is that the formula is only flagging if it's within 30 minutes in the same row. The website lead could have been generated by any time stamp in Column A+B

    i.e.

    Column C+D Row 2 has a time stamp of 2/14/2014 13:05

    Column A+B Row 2 is 2/05/2014 12:15 (which wouldn't flag it) but Row 95 could be 2/14/2014 12:55 which should cause the time stamp in row 2 to be flagged.

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    How can you possibly match up the two sets of data? Is there something left out that can tie the two data sets together?

  9. #9
    Registered User
    Join Date
    07-25-2012
    Location
    Boynton Beach
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    My thought is that the formula would check if any timestamp in A+B fit the criteria for Column D Row 2 to be flagged (etc for all rows in column D)

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Here is something that could lead to a solution.

    I inserted a column to the left of columns A and B and also to the left of columns C and D. In the new column A, I entered 1 (for the first data set) I entered 2 in the new column C (for the second data set). I then moved the second data set to be under the first data set and sorted by the Time then the Date.

    Where data set 1 meets data set 2 and the difference is 30 minutes or less, the data set 1 will be highlighted.

    I hope this helps as I am out of ideas.
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Hi,

    Try this instead of my previous attachment. I have inserted data into column E (hidden) which returns whether or not there is a time anywhere from columns A&B that is within 30 minutes of the time on that row in columns C&D. I have then used conditional formatting to highlight any rows that contain a TRUE value in column E.

    I hope this helps

  12. #12
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Sorry, my bad. Try this attachment instead...I forgot to use an array formula in column E

  13. #13
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Sorry to spam attachments at you :P, but here's the same thing without the helper column. The formula that was in column E is now wholly contained within the conditional formatting formula

  14. #14
    Registered User
    Join Date
    07-25-2012
    Location
    Boynton Beach
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Quote Originally Posted by ajryan88 View Post
    Sorry to spam attachments at you :P, but here's the same thing without the helper column. The formula that was in column E is now wholly contained within the conditional formatting formula

    Hi Ajryan88,

    This last attachment is really good. One small problem though is that it is highlighting rows that happen 30 minutes before as well as 30 minutes afterwards.

    Is there an easy fix to make it only highlight if it's 30 minutes after column A+B and not before the A+B time stamp?

    Thanks,
    Joe Butch

  15. #15
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Ah sorry, I didn't realise it was only supposed to flag 30 minutes after. Check the new attachment

    Changed the conditional format formula from
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    to
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    07-25-2012
    Location
    Boynton Beach
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Hi ajryan88

    Using your code I found an error with the conditional formatting. I've attached an excel sheet that shows it.

    The attached spreadsheet should only highlight row 2 which falls in the criteria of up to 30 minutes after column A+B.

    For some reason it's highlighting row 3.

    data-sample-4.xlsx
    Attached Files Attached Files

  17. #17
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Hi,

    It is because you changed the range of the conditional formatting to $C:$D. This means that the relative references in the formula won't work, as they were based on the range starting in row 2 (hence why rows 1 and 3 are highlighted instead of rows 2 and 4). The solution is to change the range to something like $C2:$D10000, where 10000 is a number big enough to ensure that all of your data is captured by the formula.


  18. #18
    Registered User
    Join Date
    07-25-2012
    Location
    Boynton Beach
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    Ah.. Yes! Thanks for the help.

  19. #19
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Flagging a Column if timestamp occurs within a specified timestamp of another column.

    No problems.

    Please don't forget to mark this thread as solved, and please click on the * next to my post to say thanks

    Have a great day

+ 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. update timestamp if change_event for all column in row
    By dainova in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-07-2012, 01:29 AM
  2. timestamp column not populated
    By jmaikido in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-17-2010, 11:55 PM
  3. Record timestamp in one column automatically
    By springa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-10-2009, 09:38 AM
  4. Record timestamp in one column automatically
    By gmaz2 in forum Excel General
    Replies: 21
    Last Post: 02-05-2009, 01:42 AM
  5. [SOLVED] Enter timestamp when column is modified
    By Mikus in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-04-2005, 01:05 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