简体   繁体   English

需要 Excel 中多个相关日期单元格的公式帮助

[英]Need Formula Help For Multiple Dependent Date Cells in Excel

I am trying to calculate the "Time in Stage" (TIS) for our recruiting team for each stage of the process but each cell is dependent on another cell.我正在尝试为我们的招聘团队计算流程每个阶段的“阶段时间”(TIS),但每个单元都依赖于另一个单元。 For example, let's say the process is entered into cells in order, it would look like this: A1="Date: Review Stage", B1="Date: Screen Stage", C1="Date: Assessment Stage", D1="Date: Interview Stage", E1="Date: Offer Stage", and F1="Date: Hire Stage".例如,假设过程按顺序输入到单元格中,它看起来像这样: A1="Date: Review Stage", B1="Date: Screen Stage", C1="Date: Assessment Stage", D1=" Date:Interview Stage”,E1="Date:Offer Stage",以及 F1="Date:Hire Stage"。 I am trying to calculate how long a candidate stays in each stage before advancing to the next stage.我正在尝试计算候选人在进入下一阶段之前在每个阶段停留的时间。 For example, If the candidate was added on January 1 and they were screened on January 5th, their time in the "Review" stage was 4 days.例如,如果候选人是在 1 月 1 日添加的,并在 1 月 5 日进行筛选,则他们在“Review”阶段的时间为 4 天。 Technically, if the candidate is in the "Interview Stage", the "Review" and "Screen" stages should have dates.从技术上讲,如果候选人处于“面试阶段”,“审查”和“筛选”阶段应该有日期。

Here's the problem, not all cells have a date even though the candidate went through that stage.这就是问题所在,即使候选人经历了那个阶段,也并非所有单元格都有日期。 Is there a way to calculate Time in Stage if one or more cells are blank?如果一个或多个单元格为空白,是否有一种方法可以计算阶段时间? I tried adding a TODAY column to run a nested IF statement that essentially says IF any cell (B1, C1, D1, or E1) is blank, then the TIS for cell A1 would be TODAY-Added Date (even though that's not accurate it still gives me an idea that someone has been in the process far too long and I can speak with the manager for that recruiter).我尝试添加一个 TODAY 列来运行一个嵌套的 IF 语句,该语句本质上说如果任何单元格(B1、C1、D1 或 E1)为空,则单元格 A1 的 TIS 将是今天添加的日期(即使这不准确仍然让我觉得有人在这个过程中的时间太长了,我可以和那个招聘人员的经理谈谈)。

I have the following formula: =IF([@[Date: Assessment Stage]]="",TODAY()-[@[Date: Screen Stage]],[@[Date: Assessment Stage]]-[@[Date: Screen Stage]]) .我有以下公式: =IF([@[Date: Assessment Stage]]="",TODAY()-[@[Date: Screen Stage]],[@[Date: Assessment Stage]]-[@[Date: Screen Stage]]) This would work if there is a date in the "Date: Screen Stage" cell.如果“日期:屏幕阶段”单元格中有日期,这将起作用。 The problem is that many of our recruiters don't complete each stage (ie, they go from review directly to hire) which leaves multiple dates blank so it returns "44896" so I can't determine what the time in stage is because it depends on another cell having a date.问题是我们的许多招聘人员没有完成每个阶段(即,他们 go 从审查直接到雇用),这会留下多个日期空白,因此返回“44896”,所以我无法确定阶段时间是什么,因为它取决于另一个有日期的单元格。 Some have a date in one or two cells but not all, some have no dates except the date the candidate was added and their hire date.有些在一个或两个单元格中有日期,但不是全部,有些除了添加候选人的日期和他们的雇用日期外没有日期。

Here's where I ended up.这是我结束的地方。 I placed this formula somewhere, in my case I used I2:我把这个公式放在某个地方,在我的例子中我使用了 I2:

=IF(A2>0,MIN(B2:$F2,TODAY())-A2,"")

And then copied it right, and then down.然后复制它吧,然后向下。

In cell I2 the formula is as above.在单元格 I2 中,公式如上。 But copied right, the columns are going to increment one to the right each time:但是向右复制,列将每次向右递增一:

Rvw Days Rvw 天数 Screen Days放映日 Assess Days评估天数 Intrvw Days实习日 Offer Days优惠天数
=IF(A2>0,MIN(B2:$F2,TODAY())-A2,"") =IF(A2>0,MIN(B2:$F2,TODAY())-A2,"") =IF(B2>0,MIN(C2:$F2,TODAY())-B2,"") =IF(B2>0,MIN(C2:$F2,TODAY())-B2,"") =IF(C2>0,MIN(D2:$F2,TODAY())-C2,"") =IF(C2>0,MIN(D2:$F2,TODAY())-C2,"") =IF(D2>0,MIN(E2:$F2,TODAY())-D2,"") =IF(D2>0,MIN(E2:$F2,TODAY())-D2,"") =IF(E2>0,MIN(E2:$F2,TODAY())-E2,"") =IF(E2>0,MIN(E2:$F2,TODAY())-E2,"")

What this says is "if phaseStartDate > 0, then phaseLength = whatever the next phase start to the right is, or if all to the right is blank, use today's date."这表示“如果 phaseStartDate > 0,则 phaseLength = 无论右侧的下一阶段开始是什么,或者如果右侧全部为空白,则使用今天的日期。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM