Trying to find elegant solution with formula - Determining whether an order was pending on a certain date

luckeyjune

New Member
Joined
Jun 28, 2021
Messages
12
Office Version
  1. 2016
Platform
  1. Windows
Hello,

Trying to see if anyone has ideas on how they'd approach this. I have a dataset with an entered date, completed date, and a report rundate for work orders. It also contains a days pending #. What I'm trying to do, with a series of helper columns, is to come up with a sum of how many work orders were pending for a certain company on a certain day. But, the dataset can't be run each day, so I will have to retroactively determine whether something was pending or not, on a given day. I can determine that by figuring out whether the date I'm querying falls between the enter and completed date. If it does, then it was pending on any date between entered and completed. The actual dataset is very large, so I can't use array formulas. And, the chart or pivot table I'd like to be the end result will need to be rolled up to Company level, so I'll have to be able to SUM the 1,0 result. I'd like to run this 5x/week, and have it auto-update for how many work orders were pending on a given date, based on whether that given date falls between entered and completed. I added an example of what my dataset looks like, and also what I'm trying to achieve (roughly). In the "pending" column on the chart I'm trying to achieve, that would be a SUM of how many work orders were pending on that date. I'd love any ideas. Thanks so much!
 

Attachments

  • example.JPG
    example.JPG
    159.6 KB · Views: 11

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Pending:
=COUNTIFS(CompanyNamesList,CompanyNameSearch,EnteredDate,"<" & SearchDate,CompletedDate,">" & SearchDate)
Completed:
=COUNTIFS(CompanyNamesList,CompanyNameSearch,CompletedDate,SearchDate)
Added:
=COUNTIFS(CompanyNameList,CompanyNameSearch,EnteredDate,SearchDate)

CompanyNameList - your range representing the company listed for the workorder
CompanyNameSearch - the single cell or string of the company you wish to search for (must be exact same spelling)
EnteredDate - range of dates when workorder was added
CompletedDate - range of dates when workorder was completed/expected to be completed
SearchDate - single cell or number value of date you wish to search for

Hope this all helps, any problems, let me know.
 
Upvote 0
Solution
Pending:

Completed:

Added:


CompanyNameList - your range representing the company listed for the workorder
CompanyNameSearch - the single cell or string of the company you wish to search for (must be exact same spelling)
EnteredDate - range of dates when workorder was added
CompletedDate - range of dates when workorder was completed/expected to be completed
SearchDate - single cell or number value of date you wish to search for

Hope this all helps, any problems, let me know.
Wow thank you so much. Yes, it works, perfectly. Really- I can’t thank you enough. Brilliant.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,249
Members
449,075
Latest member
staticfluids

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