Date Difference For Duplicate Entries

Pochie

New Member
Joined
Oct 16, 2020
Messages
3
Office Version
  1. 2013
Platform
  1. Windows
Hello,

I would like to ask for your assistance in creating formulas under First Day Colum and Last Day Column.

  • There are duplicate entries under Programs column
  • The First day column shall provide result of the first activity (End date minus Start date)
  • The Last day column shall provide results of the last activity (End date minus Start date)
  • Activities in between the first day and last day (same activity name) shall have a blank result
  • Activity with single entry shall has results for both First day and Last day (End date minus Start date)
Hope you can help me on this, see below sample data.

ProgramsStartEndFirst DayLast Day
Activity 110/1/2010/2/201
Activity 210/1/2010/2/2011
Activity 310/1/2010/4/203
Activity 110/1/2010/3/20
Activity 110/1/2010/4/203
Activity 310/1/2010/5/204
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Welcome to the MrExcel board!

Try this. just make sure where I have used $100 that you choose a row number that will be below your last data row.

20 10 17.xlsm
ABCDE
1ProgramsStartEndFirst DayLast Day
2Activity 101-Oct-2002-Oct-201 
3Activity 201-Oct-2002-Oct-2011
4Activity 301-Oct-2004-Oct-203 
5Activity 101-Oct-2003-Oct-20  
6Activity 101-Oct-2004-Oct-20 3
7Activity 301-Oct-2005-Oct-20 4
8  
First Last
Cell Formulas
RangeFormula
D2:D8D2=IF(COUNTA(A2:C2)=3,IF(COUNTIF(A$1:A1,A2)=0,C2-B2,""),"")
E2:E8E2=IF(COUNTA(A2:C2)=3,IF(COUNTIF(A3:A$100,A2)=0,C2-B2,""),"")
 
Upvote 0

Forum statistics

Threads
1,215,050
Messages
6,122,868
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top