+ Reply to Thread
Results 1 to 2 of 2

Compare two dates with two other dates in a whole column.

  1. #1
    Registered User
    Join Date
    09-12-2016
    Location
    Austin, Texas
    MS-Off Ver
    2010
    Posts
    2

    Compare two dates with two other dates in a whole column.

    So I have two tables, task table and user-state table. As you can see in the image.
    Task table has the start and end date for each task completed by an employee.
    And the user-state table has the start and end date for various activities performed by each employee.
    Now I want to have another column in task table called 'Available Time'. Wherein I want to calculate if for the time in between the start and end date of the task, there was a corresponding value in the user-state table with 'User_State' as 'Available' for the same employee name, then the value of the column 'Duration in Sec' is shown in the 'Available Time' column. And if there is more than one record with 'Available' state, then they should be summed up.

    • The condition for dates is as follows:
    Task_Start_Date <= State_Start_Date
    AND
    Task_End_Date >= State_Start_Date

    • The other condition is that emp name should be same in both tables and User_State should be 'Available'.

    Attaching the excel file for reference.

    I tried sumif but it looks one cell to cell. I want to look in the whole column. I think array function might work.
    Any help would be appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Compare two dates with two other dates in a whole column.

    Try in D2 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. compare dates in two columns, fill second column if date is later than first
    By kittycrickett in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-11-2015, 02:24 PM
  2. [SOLVED] Compare dates with a table of years and return value from adjacent column
    By jonus in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-25-2015, 07:35 AM
  3. [SOLVED] compare dates in column with unique date on current month
    By bmbalamurali in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-23-2015, 06:05 AM
  4. compare column of dates to a corresponding column of dates
    By redracer_101 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-05-2014, 05:02 AM
  5. [SOLVED] Compare dates in first column of table
    By velvasi in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2014, 11:13 PM
  6. Replies: 4
    Last Post: 02-18-2014, 07:29 PM
  7. [SOLVED] Compare dates across columns and return column header
    By huy_le in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-29-2013, 07:07 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