Compute data in other cell if cell is blank

RoxyS

New Member
Joined
Mar 8, 2019
Messages
5
Question: How many employees were promoted more than 7 months ago (Column C)? If they were not promoted, then how many employees were hired more than 7 months ago (Column B)?

[TABLE="width: 500"]
<tbody>[TR]
[TD]Employee[/TD]
[TD]Hire Date[/TD]
[TD]Last Promotion Date[/TD]
[/TR]
[TR]
[TD]Employee 1[/TD]
[TD][TABLE="width: 123"]
<tbody>[TR]
[TD="class: xl65, width: 123"]09/12/2013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]01/01/2018[/TD]
[/TR]
[TR]
[TD]Employee 2[/TD]
[TD][TABLE="width: 123"]
<tbody>[TR]
[TD="class: xl65, width: 123"]18/04/2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Employee 3[/TD]
[TD][TABLE="width: 123"]
<tbody>[TR]
[TD="class: xl65, width: 123"]11/06/2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Employee 4[/TD]
[TD][TABLE="width: 123"]
<tbody>[TR]
[TD="class: xl65, width: 123"]02/08/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Employee 5[/TD]
[TD][TABLE="width: 123"]
<tbody>[TR]
[TD="class: xl65, width: 123"]16/05/2016[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]11/07/2019[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Let's establish something first.
More than 7 months ago means more than 7 months, ie 8, 9, 10, 11, 12, months etc
Not 7.
7 is not more than 7.
If you mean 7 or more then you need to include an equals in the formulas below.

Based on that

How many promoted more than 7 months ago
=SUMPRODUCT((DATEDIF(C1:C5,TODAY(),"m")>7)*(C1:C5<>""))

How many hired more than 7 months ago that were not promoted
=SUMPRODUCT((DATEDIF(B1:B5,TODAY(),"m")>7)*(C1:C5=""))
 
Last edited:
Upvote 0
Another option

Excel Workbook
ABCDEF
1EmployeeHire DateLast Promotion DatePromoted > 7 months ago:1
2Employee 19/12/20131/01/2018Not Promoted but Hired > 7 months ago:2
3Employee 218/04/2018
4Employee 311/06/2018
5Employee 42/08/2019
6Employee 516/05/201611/07/2019
Count
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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