Formula Creation Help

MrHopeless

New Member
Joined
Dec 22, 2022
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
Excel Test.JPG



Hello- I need help with trying to get a formula to do the following:

If(B12 = "New Lease", figure out the duration for Occupant John Doe from C8 to D11). However, I do not want it to capture the Occupant, Paula Doe. Or, I am ok with doing a separate column to calculate the duration of the Occupants and plugging those results into my other formula.

Thank you
 
Maybe this:
Book1
ABCDE
1
2
3OccupantType of leaseLease StartLease End
4
5Paula DoeNew Lease12/10/201212/9/2013 
6Paula DoeLease Renewal12/10/201312/9/2014 
7Paula DoeLease Renewal12/10/201412/9/20152 Yr 11 month 29 days
8John DoeNew Lease12/10/201512/9/2016 
9John DoeLease Renewal12/10/201612/9/2017 
10John DoeLease Renewal12/10/201712/9/2019 
11John DoeLease Renewal3/16/20206/15/20215 Yr 6 month 5 days
12Jane DoeNew Lease9/9/20219/8/20220 Yr 11 month 30 days
Sheet1
Cell Formulas
RangeFormula
E5:E12E5=IF(A6=A5,"",DATEDIF(MINIFS($C$5:$C$12,$A$5:$A$12,A5),MAXIFS($D$5:$D$12,$A$5:$A$12,A5),"y")&" Yr "&DATEDIF(MINIFS($C$5:$C$12,$A$5:$A$12,A5),MAXIFS($D$5:$D$12,$A$5:$A$12,A5),"ym")&" month "&DATEDIF(MINIFS($C$5:$C$12,$A$5:$A$12,A5),MAXIFS($D$5:$D$12,$A$5:$A$12,A5),"md")&" days ")
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Maybe this:
Book1
ABCDE
1
2
3OccupantType of leaseLease StartLease End
4
5Paula DoeNew Lease12/10/201212/9/2013 
6Paula DoeLease Renewal12/10/201312/9/2014 
7Paula DoeLease Renewal12/10/201412/9/20152 Yr 11 month 29 days
8John DoeNew Lease12/10/201512/9/2016 
9John DoeLease Renewal12/10/201612/9/2017 
10John DoeLease Renewal12/10/201712/9/2019 
11John DoeLease Renewal3/16/20206/15/20215 Yr 6 month 5 days
12Jane DoeNew Lease9/9/20219/8/20220 Yr 11 month 30 days
Sheet1
Cell Formulas
RangeFormula
E5:E12E5=IF(A6=A5,"",DATEDIF(MINIFS($C$5:$C$12,$A$5:$A$12,A5),MAXIFS($D$5:$D$12,$A$5:$A$12,A5),"y")&" Yr "&DATEDIF(MINIFS($C$5:$C$12,$A$5:$A$12,A5),MAXIFS($D$5:$D$12,$A$5:$A$12,A5),"ym")&" month "&DATEDIF(MINIFS($C$5:$C$12,$A$5:$A$12,A5),MAXIFS($D$5:$D$12,$A$5:$A$12,A5),"md")&" days ")
I am sorry my job is cheap. We only have Office Professional 2016. The MINIFS and MAXIFS is only form 2019 to Present. **** I feel ashamed. Makes me want to buy the new versions for them. Another solution? Maybe Index and Aggregate? I heard it might be similar.
 
Upvote 0
This is an array formula that needs to entered with CTRL-SHIFT-ENTER. Then drag down as needed.

Book1
ABCDE
1
2
3OccupantType of leaseLease StartLease End
4
5Paula DoeNew Lease12/10/201212/9/2013 
6Paula DoeLease Renewal12/10/201312/9/2014 
7Paula DoeLease Renewal12/10/201412/9/20152 Yr 11 month 29 days
8John DoeNew Lease12/10/201512/9/2016 
9John DoeLease Renewal12/10/201612/9/2017 
10John DoeLease Renewal12/10/201712/9/2019 
11John DoeLease Renewal3/16/20206/15/20215 Yr 6 month 5 days
12Jane DoeNew Lease9/9/20219/8/20220 Yr 11 month 30 days
Sheet1
Cell Formulas
RangeFormula
E5:E12E5=IF(A6=A5,"",DATEDIF(MIN(IF($A$5:$A$12=A5,$C$5:$C$12)),MAX(IF($A$5:$A$12=A5,$D$5:$D$12)),"y")&" Yr "&DATEDIF(MIN(IF($A$5:$A$12=A5,$C$5:$C$12)),MAX(IF($A$5:$A$12=A5,$D$5:$D$12)),"ym")&" month "&DATEDIF(MIN(IF($A$5:$A$12=A5,$C$5:$C$12)),MAX(IF($A$5:$A$12=A5,$D$5:$D$12)),"md")&" days ")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
This is an array formula that needs to entered with CTRL-SHIFT-ENTER. Then drag down as needed.

Book1
ABCDE
1
2
3OccupantType of leaseLease StartLease End
4
5Paula DoeNew Lease12/10/201212/9/2013 
6Paula DoeLease Renewal12/10/201312/9/2014 
7Paula DoeLease Renewal12/10/201412/9/20152 Yr 11 month 29 days
8John DoeNew Lease12/10/201512/9/2016 
9John DoeLease Renewal12/10/201612/9/2017 
10John DoeLease Renewal12/10/201712/9/2019 
11John DoeLease Renewal3/16/20206/15/20215 Yr 6 month 5 days
12Jane DoeNew Lease9/9/20219/8/20220 Yr 11 month 30 days
Sheet1
Cell Formulas
RangeFormula
E5:E12E5=IF(A6=A5,"",DATEDIF(MIN(IF($A$5:$A$12=A5,$C$5:$C$12)),MAX(IF($A$5:$A$12=A5,$D$5:$D$12)),"y")&" Yr "&DATEDIF(MIN(IF($A$5:$A$12=A5,$C$5:$C$12)),MAX(IF($A$5:$A$12=A5,$D$5:$D$12)),"ym")&" month "&DATEDIF(MIN(IF($A$5:$A$12=A5,$C$5:$C$12)),MAX(IF($A$5:$A$12=A5,$D$5:$D$12)),"md")&" days ")
Press CTRL+SHIFT+ENTER to enter array formulas.
You, @HongRu and a little help from @Scott Huish just made my life much more easier. Thank you all.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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