Excel - Finding first non blank and then match to specific date

Statto1970

New Member
Joined
Feb 5, 2019
Messages
11
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. Web
Hello

I am trying to match the first non blank entry (D2:H2) against a persons name (A2), then when I have found this bring back the date above the relevant cell (D1:H1).

For example if NAME 1 (A2) first non blank cell is D2, then I want the date contained in D1 to autofil into B2.

I hope this makes sense.
Thank you in advance.
 

Attachments

  • example.JPG
    example.JPG
    46 KB · Views: 11
You're welcome!
Let me explain further.

AGGREGATE has many functions and I'm using 15 (SMALL) and 14 (LARGE).
For the array argument I'm using the COLUMN numbers instead of just the cell references, so it will look through 4 to 9 (column D to column I) but I subtract 3 (column C) so the INDEX receives 1, 2, 3, 4, 5 or 6 to pick up the correct date from $D$1:$I$1.

I divide each column number by ($D2:$I2<>"") so if it is empty it gives FALSE or a logical zero which generates a zero divide which the AGGREGATE 6 option (Ignore error values) then ignores. If ($D2:$I2<>"") is TRUE I get a logical one which divided into the row number and returns the row I want.

The ",1" at the end is for the SMALLest and LARGEst results. i.e. if I use ",2" then I'd get the second non-empty cell with the 15 option and the penultimate non-empty cell with the 14 option.
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Perhaps this?
=MINIFS(D$1:I$1,D2:I2,"<>")
With just a screen capture to go on, that could possibly be an incorrect answer.
I am trying to match the first non blank entry (D2:H2)
"<>" works with empty cells but not formula blanks.
decided to use my fallback of AGGREGATE with it's SMALL and LARGE options.
You don't need to use INDEX when the results are numeric, without it you can remove the COLUMN references from the array and make it more efficient.

Earliest date =AGGREGATE(15,6,$D$1:$I$1/($D2:$I2<>""),1)
Latest date =AGGREGATE(14,6,$D$1:$I$1/($D2:$I2<>""),1)
 
Upvote 0

Forum statistics

Threads
1,215,681
Messages
6,126,192
Members
449,298
Latest member
Jest

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