+ Reply to Thread
Results 1 to 8 of 8

Comparing time values in 2 different sheets

  1. #1
    Registered User
    Join Date
    05-08-2016
    Location
    LA
    MS-Off Ver
    the latest
    Posts
    15

    Comparing time values in 2 different sheets

    Hi, all.

    Regarding the attached spreadsheet, is there a formula that will allow me to flag any time values in sheet 2 that do NOT appear in any of the time ranges in sheet 1?

    Kind thanks for any help.

    NOTE: I cross-posted in one other location.

    http://forum.chandoo.org/threads/fla...-sheets.30730/
    Attached Files Attached Files
    Last edited by PrestonT; 08-10-2016 at 03:47 PM.

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Comparing time values in 2 different sheets

    Please let us know if you have found your solution (in both posts) and include where that solution is.

    In the attached I made three helper columns to combine the dates with the times. This simplifies the final formula and resolves any possible trans-midnight calculations should they occur.

    In Sheet1 I just added the dates to "In" and did the same with "Out" (columns E:F). In Sheet2 I added the dates to the target times.

    Then in column D of Sheet2 this formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  3. #3
    Registered User
    Join Date
    05-08-2016
    Location
    LA
    MS-Off Ver
    the latest
    Posts
    15

    Re: Comparing time values in 2 different sheets

    Thank you. This resolves my question.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Comparing time values in 2 different sheets

    You are welcome. Glad to hear it. Thank you for the feedback.

  5. #5
    Registered User
    Join Date
    05-08-2016
    Location
    LA
    MS-Off Ver
    the latest
    Posts
    15

    Re: Comparing time values in 2 different sheets

    No problem!

    One quick follow-up question: Can I enter new sets of data into the spreadsheet without breaking any of the formulas (so that it still flags what I need to have flagged?)

    Thank you!

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Comparing time values in 2 different sheets

    Yes, and if I understand you correctly you will need to edit the formula ranges 'Sheet 1'!$E$2:$E$2081 and 'Sheet 1'!$F$2:$F$2081 to be at least the size of the new source data range.

    A good strategy for future data additions and minimal future formula edits is to write the formula with ranges a little bit larger than anticipated needs. If for example you anticipate a maximum of 3000 rows of data consider making the formula range 'Sheet 1'!$E$2:$E$3500 or even 'Sheet 1'!$E$2:$E$4000.

    The main point being:
    You want to avoid yielding to the temptation to reference whole columns (that's 1,048,576 rows). Doing that forces Excel to do over one million unnecessary calculations multiple times. It slows the workbook down.
    Last edited by FlameRetired; 08-14-2016 at 06:30 PM.

  7. #7
    Registered User
    Join Date
    05-08-2016
    Location
    LA
    MS-Off Ver
    the latest
    Posts
    15

    Re: Comparing time values in 2 different sheets

    Got it. Many thanks.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Comparing time values in 2 different sheets

    You're welcome.

+ 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: 10-01-2013, 02:41 AM
  2. calulating costs with vba, by comparing values from different sheets
    By benjamin.grimm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-13-2013, 08:31 AM
  3. Comparing 2 sheets and highlighting completed values
    By norrillous in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-05-2013, 02:44 AM
  4. Comparing Values between 2 sheets and inputting a comment if different
    By superpenguin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-12-2012, 11:38 AM
  5. Comparing values in two columns on two sheets
    By aaronhallstrom in forum Excel General
    Replies: 2
    Last Post: 06-10-2011, 04:39 PM
  6. Replies: 1
    Last Post: 02-17-2010, 06:56 PM
  7. Error when comparing time values
    By cas8100 in forum Excel General
    Replies: 6
    Last Post: 12-07-2009, 12:41 PM
  8. comparing values in two sheets of same workbook
    By xindaiel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-07-2008, 06:35 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