Find MAX Column In An Array

excelbytes

Active Member
Joined
Dec 11, 2014
Messages
257
Office Version
  1. 365
Platform
  1. Windows
I need to find the last column that a certain person would appear. For example, in this table, I would want a formula that would result in 6/3/2024 for Person 2 (which is in cell I9. I used Power Query to unpivot the table then used MAXIFS to find that result, but was wondering if there was a formula way to accomplish this.


MAXIFS.png
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Try
Excel Formula:
=MAX(IF(B3:K9="Person 2",B2:K2))
 
Upvote 0
How about
Excel Formula:
=INDEX(2:2,AGGREGATE(14,6,COLUMN(B2:K2)/(B2:K9="Person 2"),1))
 
Upvote 0
How about
Excel Formula:
=INDEX(2:2,AGGREGATE(14,6,COLUMN(B2:K2)/(B2:K9="Person 2"),1))
I entered this formula:

=INDEX(2:2,AGGREGATE(14,6,COLUMNS(Sheet2!$B$2:$K$2)/(Sheet2!$B$2:$K$9=B3),1))

I got this when I copied it down:

Fri
Y
1/0/1900​
Y
Y
Y
1/0/1900​
1/0/1900​
Y
#NUM!​
Y

What is the purpose of 2:2 for the INDEX range and is it supposed to change to 3:3, 4:4, etc as I copy it down?
 
Upvote 0
If your going to drag it down it needs to be
Excel Formula:
=INDEX(Sheet2!$2:$2,AGGREGATE(14,6,COLUMN(Sheet2!$B$2:$K$2)/(Sheet2!$B$2:$K$9=B3),1))
 
Upvote 0
If your going to drag it down it needs to be
Excel Formula:
=INDEX(Sheet2!$2:$2,AGGREGATE(14,6,COLUMN(Sheet2!$B$2:$K$2)/(Sheet2!$B$2:$K$9=B3),1))
I changed the formula to:

=INDEX(Sheet2!$B$2:$K$2,AGGREGATE(14,6,COLUMNS(Sheet2!$B$2:$K$2)/(Sheet2!$B$2:$K$9=B3),1))

Now it just shows 6/5/2024 all the way down, which is correct for some of the Persons, but not all.
 
Upvote 0
I entered this formula:

=MAX(IF(Sheet2!$B$3:$K$9=Sheet1!B3,Sheet2!$B$2:$K$2))

It just returned all zeros.
That means 1) there are no match or 2) your date headers are text and not date.
 
Upvote 0
Book1
ABCDEFGHIJKLMN
1
25/27/245/28/245/29/245/30/245/31/246/1/246/2/246/3/246/4/246/5/24
3Person 9Person 3Person 2Person 7Person 2Person 7Person 1Person 4Person 8Person 1Person 16/5/24
4Person 1Person 5Person 6Person 6Person 1Person 3Person 5Person 1Person 2Person 9Person 26/4/24
5Person 6Person 7Person 3Person 8Person 1Person 9Person 9Person 8Person 7Person 5Person 36/3/24
6Person 7Person 2Person 8Person 3Person 3Person 4Person 2Person 3Person 7Person 6Person 46/3/24
7Person 9Person 1Person 3Person 2Person 4Person 3Person 2Person 7Person 8Person 8Person 56/5/24
8Person 6Person 1Person 7Person 7Person 3Person 7Person 3Person 7Person 5Person 5Person 66/5/24
9Person 8Person 5Person 3Person 1Person 8Person 7Person 1Person 2Person 2Person 6Person 76/4/24
10Person 86/5/24
11Person 96/5/24
Sheet1
Cell Formulas
RangeFormula
C2:K2C2=B2+1
N3:N11N3=MAX(IF($B$3:$K$9=M3,$B$2:$K$2))
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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