How to find all the cells in a particular column when other column meets a condition?

rooigle

New Member
Joined
Dec 24, 2018
Messages
5
Hello members of Mr Excel,

My puzzle presents as follows ...


I have a table that looks pretty much like the following in a sample version:


Date1 MO2 MO3 MO6 MO1 YR2 YR3 YR5 YR7 YR10 YR20 YR30 YR
########2.412.422.392.542.622.632.612.642.722.792.923.03
########2.312.332.372.522.72.82.832.842.923.013.193.3
########2.22.262.342.492.692.872.932.983.073.153.33.39
########2.122.192.362.592.812.882.943.013.053.133.19
########1.952.112.282.462.622.72.742.812.862.953.02
########1.942.032.212.442.672.772.852.922.963.033.08
########1.771.932.112.332.522.632.732.812.852.912.98

<tbody>
</tbody>


Basically, I want two things:

1. To return in successive rows (single column) the dates that correspond to those raw wherein the value in column 5 YR was greater than that in column 7 YR.

2. (related to the previous) To return in a single cell, the count of the number of rows wherein (again) the value in column 5 YR was greater than that in column 7 YR.


I think that the idea it's simple but I cannot get my head around it. I have been trying VLOOKUP, INDEX, MATH, COUNTIF, etc, but I was unsuccessful to date.


Thank you for your help! :)
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
How about

Excel 2013/2016
ABCDEFGHIJKLMNOP
1Date1 MO2 MO3 MO6 MO1 YR2 YR3 YR5 YR7 YR10 YR20 YR30 YR
201/12/20182.412.422.392.542.622.632.612.642.722.792.923.0303/12/20182
302/12/20182.312.332.372.522.72.82.832.842.923.013.193.306/12/2018
403/12/20182.22.262.342.492.692.872.933.93.073.153.33.39
504/12/20182.122.192.362.592.812.882.943.013.053.133.19
605/12/20181.952.112.282.462.622.72.742.812.862.953.02
706/12/20181.942.032.212.442.672.772.852.652.963.033.08
807/12/20181.771.932.112.332.522.632.732.812.852.912.98
Sheet4
Cell Formulas
RangeFormula
O2{=IFERROR(INDEX($A$2:$A$8,SMALL(IF($I$2:$I$8>$J$2:$J$8,ROW($A$2:$A$8)-ROW($A$2)+1),ROWS($1:1))),"")}
P2{=SUM(--(I2:I8>J2:J8))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Dear Fluff,


First of all, thanks for your quick reply!

I have been able to make the second formula work (=SUM...) but the first one yields me the same date (the first date when the condition is met) in all the cells that I target the array formula to. Any idea of what may I be doing wrong?


Thank you for your help!
 
Upvote 0
Are your dates actual dates, rather than text values?
Also are they dates or date & time?
 
Upvote 0
Just to be more specific I copy the table wherein I am using now, plus the formula.


Formula (using it properly as an array function):

{=IFERROR(INDEX($A$7:$A$49,SMALL(IF($B$7:$B$49>$C$7:$C$49,ROW($A$7:$A$49)-ROW($A$7)+1),ROWS($7:7))),"")}


Table (wherein "2008 Quarter 1" is in cell A7 and the table ends in A49):


NATIONAL DELINQUENCY RATES
QuarterPercent Delinquent
90 Days or More
Percent Delinquent
30 or 60 Days
2008 Quarter 12.13.12009 Quarter 2
2008 Quarter 22.42.82009 Quarter 2
2008 Quarter 32.52.82009 Quarter 2
2008 Quarter 43.03.32009 Quarter 2
2009 Quarter 13.73.82009 Quarter 2
2009 Quarter 24.33.32009 Quarter 2
2009 Quarter 34.93.32009 Quarter 2
2009 Quarter 45.43.5
2010 Quarter 15.93.6
2010 Quarter 26.03.1
.........

<tbody>
</tbody>


The formula has been applied on the far-right column and, as you can see, it constantly renders the same output.
 
Upvote 0
Not sure why it's doing that as it works for me


Excel 2013/2016
ABCD
6QuarterPercent Delinquent 90 Days or MorePercent Delinquent 30 or 60 Days
72008 Quarter 22.42.82009 Quarter 2
82008 Quarter 32.52.82009 Quarter 3
92008 Quarter 433.32009 Quarter 4
102009 Quarter 13.73.82010 Quarter 1
112009 Quarter 24.33.32010 Quarter 2
122009 Quarter 34.93.3
132009 Quarter 45.43.5
142010 Quarter 15.93.6
152010 Quarter 263.1
Sheet4
Cell Formulas
RangeFormula
D7{=IFERROR(INDEX($A$7:$A$49,SMALL(IF($B$7:$B$49>$C$7:$C$49,ROW($A$7:$A$49)-ROW($A$7)+1),ROWS($7:7))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Right, I now know what I was doing wrong. I was using it over several rows at the same time thinking that I had to do so since it was an array. Apparently I just had to drag it down from the first row.

Your formula works impeccably. Thank you Fluff!
 
Upvote 0
Glad you sorted it out & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,553
Messages
6,125,483
Members
449,233
Latest member
Deardevil

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