Return specified number of rows with "IF" or "IFS" formulas

WhatTheF

New Member
Joined
Feb 25, 2025
Messages
17
Office Version
  1. 2021
Platform
  1. Windows
My workbook has two columns of dates, and Intake Date and a Disposition Date. There are only two possible dispositions, "RELEASED" or "EUTHANIZED". Unfortunately, in many of these circumstances, no one bothers to fill out this portion like the should have. However, they do enter the dates correctly. We also know how many, total, intakes and releases we have on the report.

What I'm looking for is a formula that will generate the number of rows for the amount of intakes (A1), with the results being, if the Intake Date is the same as the Disposition Date, "EUTHANIZED", if not, "RELEASED". Please see my mini Sheet below for my example.

Book1
ABC
111
2Intake DateDisposition DateDisposition
31/5/20235/15/2023RELEASED
41/6/20235/27/2023RELEASED
52/10/20235/21/2023RELEASED
62/17/20234/18/2023RELEASED
72/18/20232/18/2023EUTHANIZED
83/6/20234/2/2023RELEASED
93/8/20234/20/2023RELEASED
103/13/20235/10/2023RELEASED
113/16/20233/16/2023EUTHANIZED
123/22/20233/24/2023RELEASED
133/30/20233/30/2023EUTHANIZED
Sheet1
 
Try:

Book2
ABC
111
2Intake DateDisposition DateDisposition
31/5/20235/15/2023RELEASED
41/6/20235/27/2023RELEASED
52/10/20235/21/2023RELEASED
62/17/20234/18/2023RELEASED
72/18/20232/18/2023EUTHANIZED
83/6/20234/2/2023RELEASED
93/8/20234/20/2023RELEASED
103/13/20235/10/2023RELEASED
113/16/20233/16/2023EUTHANIZED
123/22/20233/24/2023RELEASED
133/30/20233/30/2023EUTHANIZED
14
Sheet2
Cell Formulas
RangeFormula
C3:C13C3=IF(A3:A13=B3:B13,"EUTHANIZED","RELEASED")
Dynamic array formulas.
 
Upvote 0
Try:

Book2
ABC
111
2Intake DateDisposition DateDisposition
31/5/20235/15/2023RELEASED
41/6/20235/27/2023RELEASED
52/10/20235/21/2023RELEASED
62/17/20234/18/2023RELEASED
72/18/20232/18/2023EUTHANIZED
83/6/20234/2/2023RELEASED
93/8/20234/20/2023RELEASED
103/13/20235/10/2023RELEASED
113/16/20233/16/2023EUTHANIZED
123/22/20233/24/2023RELEASED
133/30/20233/30/2023EUTHANIZED
14
Sheet2
Cell Formulas
RangeFormula
C3:C13C3=IF(A3:A13=B3:B13,"EUTHANIZED","RELEASED")
Dynamic array formulas.
I appreciate this, but the number in A1 will change, daily. I'm looking for something that will reference A1 as the number of rows to create.

EDIT:
It will reference A1 as the number of rows to create while executing the IF formula, without any additional input or drag-down.
 
Upvote 0
Something like this then?

25 03 07.xlsm
ABC
111
2Intake DateDisposition DateDisposition
35/01/202315/05/2023RELEASED
46/01/202327/05/2023RELEASED
510/02/202321/05/2023RELEASED
617/02/202318/04/2023RELEASED
718/02/202318/02/2023EUTHANIZED
86/03/20232/04/2023RELEASED
98/03/202320/04/2023RELEASED
1013/03/202310/05/2023RELEASED
1116/03/202316/03/2023EUTHANIZED
1222/03/202324/03/2023RELEASED
1330/03/202330/03/2023EUTHANIZED
14
15
Spill down
Cell Formulas
RangeFormula
C3:C13C3=LET(d,INDEX(A3:B1000,SEQUENCE(A1),{1,2}),IF(INDEX(d,0,1)=INDEX(d,0,2),"EUTHANIZED","RELEASED"))
Dynamic array formulas.
 
Upvote 0
You could do something like this:

Book2
ABC
111
2Intake DateDisposition DateDisposition
31/5/20235/15/2023RELEASED
41/6/20235/27/2023RELEASED
52/10/20235/21/2023RELEASED
62/17/20234/18/2023RELEASED
72/18/20232/18/2023EUTHANIZED
83/6/20234/2/2023RELEASED
93/8/20234/20/2023RELEASED
103/13/20235/10/2023RELEASED
113/16/20233/16/2023EUTHANIZED
123/22/20233/24/2023RELEASED
133/30/20233/30/2023EUTHANIZED
14
Sheet2
Cell Formulas
RangeFormula
C3:C13C3=LET(f,FILTER(A3:B1000,A3:A1000<>""),IF(INDEX(f,0,1)=INDEX(f,0,2),"EUTHANIZED","RELEASED"))
Dynamic array formulas.


In this formula, you don't need a value in A1. The formula looks for how many rows in column A have data in them.
 
Upvote 0

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