Calculate number of days given certain criteria

sanjorge06

New Member
Joined
Oct 19, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Good day, hopefully I can get some help as I am not an Excel avid user. I am trying to calculate the number of days between 2 dates if certain criteria is met. As seen in the pic, Column B contains Order Numbers, each order number has multiple rows as each process step has a different sequence number (Column H). Each process step for each order has 3 dates, Last activity (Column L), Create date (Column M), and Due Date (Column N). For Step Numbers 10, 15, or 20 I need to calculate the amount of days between the "Create Date" (Column M) and "Last Activity" (Column L) and return the result in column O. For every other Step Number (Not 10, 15, or 20) I need to calculate the days between each step's Last Activity (Rows) up to the last row containing the same Order Number. If a new order number appears in a row, it will contain the Step Number 10, 15, or 20 and must calculate as described above.

The file contains 448 different order numbers and 5981 rows. Is there a way to create a formula to include all criteria and copy from row 2 to 5981?

Thank you
 

Attachments

  • LT Capture.JPG
    LT Capture.JPG
    129.4 KB · Views: 42

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hello SJ,

I hope I understood correctly the second condition.
Used dummy dates - please use xl2bb addin next time (XL2BB - Excel Range to BBCode) so we can copy paste your numbers in Excel.

Cell Formulas
RangeFormula
C7C7=D7+8
F7:F30F7=IF(J7=TRUE, DAYS(C7,D7),"-")
G7:G30G7=IF(L7=TRUE,DAYS(C8,C7),"")
L7:L30L7=AND(B7<>$I$7,B7<>$I$8,B7<>$I$9)
M7:M30M7=IF(A7=A6,M6,M6+1)
C8:C30C8=C7+1
D20:E30,D19,D8:E18D8=D7
E19E19=E18-5
J7:J30J7=OR(B7=$I$7,B7=$I$8,B7=$I$9)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
L7:L30Cell Value=FALSEtextNO
J7:J30Cell Value=TRUEtextNO
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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