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

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
As long as they are proper dates

=MINIFS(D$1:I$1,D2:I2,1)
 
Upvote 0
Hi Statto1970,

Here's one solution using Excel 2016:

Statto1970.xlsx
ABCDEFGHI
1NameFirst Date WantedLast Date WantedFri 01/01/1960Fri 08/01/1960Fri 15/01/1960Fri 22/01/1960Fri 29/01/1960Fri 05/02/1960
2Name 1Fri 01/01/1960Fri 05/02/19601111
3Name 2Fri 08/01/1960Fri 05/02/196011
4Name 3Fri 15/01/1960Fri 05/02/19601111
5Name 4Fri 08/01/1960Fri 08/01/19601
6Name 5Fri 08/01/1960Fri 15/01/196011
7Name 6Fri 05/02/1960Fri 05/02/19601
Sheet1
Cell Formulas
RangeFormula
B2:B7B2=INDEX($D$1:$I$1,,MATCH(1,D2:I2,0))
C2:C7C2=INDEX($D$1:$I$1,LOOKUP(2,1/(D2:I2<>""),COLUMN(D1:J1))-COLUMN($C$1))
 
Upvote 0
@Statto1970
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Thank you. These work perfectly. Much appreciated.

If I wanted to have it recognise other numbers or text in the cells rather than just 1's, how would I change the formula?
 
Upvote 0
recognise other numbers or text
number or text or numbers and text?

With some formulas, methods for text do not work with numeric values and vice versa. The method for numbers can also vary depending on whether possible entries are positive or negative and whether or not 0 is a valid entry.
 
Upvote 0
Perhaps this?
=MINIFS(D$1:I$1,D2:I2,"<>")
 
Upvote 0
My Last Date Wanted already supported either text or numeric. For First Date Wanted I was going to give you an array formula but decided to use my fallback of AGGREGATE with it's SMALL and LARGE options.

Statto1970.xlsx
ABCDEFGHI
1NameFirst Date WantedLast Date WantedFri 01/01/1960Fri 08/01/1960Fri 15/01/1960Fri 22/01/1960Fri 29/01/1960Fri 05/02/1960
2Name 1Fri 01/01/1960Fri 05/02/1960Goat1DogCat
3Name 2Fri 08/01/1960Fri 05/02/196087669922
4Name 3Fri 15/01/1960Fri 05/02/1960ABCD
5Name 4Fri 08/01/1960Fri 08/01/19601.2
6Name 5Fri 08/01/1960Fri 15/01/1960MoleRabbit
7Name 6Fri 05/02/1960Fri 05/02/1960Big Dog
Sheet2
Cell Formulas
RangeFormula
B2:B7B2=INDEX($D$1:$I$1,,AGGREGATE(15,6,COLUMN($D2:$I2)-COLUMN($C2)/($D2:$I2<>""),1))
C2:C7C2=INDEX($D$1:$I$1,,AGGREGATE(14,6,COLUMN($D2:$I2)-COLUMN($C2)/($D2:$I2<>""),1))
 
Upvote 0
number or text or numbers and text?

With some formulas, methods for text do not work with numeric values and vice versa. The method for numbers can also vary depending on whether possible entries are positive or negative and whether or not 0 is a valid entry.

It will most likely be both numbers and text. For example it could be 5C or R5 or just 5.

We are still working out the best way to enter and display our data.

Thank you.
 
Upvote 0
My Last Date Wanted already supported either text or numeric. For First Date Wanted I was going to give you an array formula but decided to use my fallback of AGGREGATE with it's SMALL and LARGE options.

Statto1970.xlsx
ABCDEFGHI
1NameFirst Date WantedLast Date WantedFri 01/01/1960Fri 08/01/1960Fri 15/01/1960Fri 22/01/1960Fri 29/01/1960Fri 05/02/1960
2Name 1Fri 01/01/1960Fri 05/02/1960Goat1DogCat
3Name 2Fri 08/01/1960Fri 05/02/196087669922
4Name 3Fri 15/01/1960Fri 05/02/1960ABCD
5Name 4Fri 08/01/1960Fri 08/01/19601.2
6Name 5Fri 08/01/1960Fri 15/01/1960MoleRabbit
7Name 6Fri 05/02/1960Fri 05/02/1960Big Dog
Sheet2
Cell Formulas
RangeFormula
B2:B7B2=INDEX($D$1:$I$1,,AGGREGATE(15,6,COLUMN($D2:$I2)-COLUMN($C2)/($D2:$I2<>""),1))
C2:C7C2=INDEX($D$1:$I$1,,AGGREGATE(14,6,COLUMN($D2:$I2)-COLUMN($C2)/($D2:$I2<>""),1))

Thank you. I am slowly beginning to understand.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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