Create list of non-empty cells with corresponding Date and Category

Danielneedshelp

New Member
Joined
Aug 31, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

I have a range of cells where I manually enter names at the intersection of a certain date and category. I'd like to automatically make a list in one column of every name I've entered while ignoring empty cells and have adjacent columns list the corresponding date and category.
Here is a simplified version of where I would manually input the names:

2023-08-31 10_01_07-Book1 - Excel.png


And here is the corresponding desired output I'd like to achieve (I've done this manually, but looking to automate it):

2023-08-31 10_04_39-Book1 - Excel.png


In the case I'd input more names, I'd like for the name to be added to the output list with the corresponding date and category. The order doesn't matter so long as each row has the correct corresponding date and category.

A few precisions:
  • I can't use VBA
  • Some names will repeat
  • I'd prefer to output to another sheet
  • I'm using Excel 365

Any help would be very much appreciated as this seems so simple in my head but I cant get it to work.
Thanks so much.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
If you convert your range to a table and add the heading "Category" you could use the below, it will update if you add in more dates, categories and names:
Book1
ABCDEFGHIJK
1Category21/08/202322/08/202323/08/202324/08/202325/08/2024DateNameCat
2CAT1BettyArnoldBetty21/08/2023BettyCAT1
3CAT2SusanArnold21/08/2023SusanCAT2
4CAT3JimSam21/08/2023DaveCAT5
5CAT4Connie23/08/2023ArnoldCAT1
6CAT5Dave23/08/2023JimCAT3
7CAT6George23/08/2023ConnieCAT4
824/08/2023BettyCAT1
924/08/2023ArnoldCAT2
1025/08/2024SamCAT3
1125/08/2024GeorgeCAT6
Sheet1
Cell Formulas
RangeFormula
I2:K11I2=LET( d,TOCOL(Table1[#Headers]&","&Table1&","&Table1[Category]), t,FILTER(d,(NOT(ISNUMBER(FIND(",,",d))))*(LEFT(d,8)<>"Category")), xml,"<t><s>"&SUBSTITUTE(t,",","</s><s>")&"</s></t>", SORT(FILTERXML(xml,"//s["&SEQUENCE(,3)&"]"),1,1))
Dynamic array formulas.
 
Upvote 0
Hi & welcome to MrExcel.
Another option
Fluff.xlsm
ABCDEF
1Category21/08/202322/08/202323/08/202324/08/202325/08/2024
2CAT1BettyArnoldBetty
3CAT2SusanArnold
4CAT3JimSam
5CAT4Connie
6CAT5Dave
7CAT6George
8
Sheet1


Fluff.xlsm
ABC
1DateNameCategory
221/08/2023BettyCAT1
323/08/2023ArnoldCAT1
424/08/2023BettyCAT1
521/08/2023SusanCAT2
624/08/2023ArnoldCAT2
723/08/2023JimCAT3
825/08/2024SamCAT3
923/08/2023ConnieCAT4
1021/08/2023DaveCAT5
1125/08/2024GeorgeCAT6
12
Sheet2
Cell Formulas
RangeFormula
A1:C11A1=LET(d,Sheet1!B2:F20,VSTACK({"Date","Name","Category"},HSTACK(TOCOL(IF(d<>"",Sheet1!B1:F1,1/0),2),TOCOL(d,1),TOCOL(IF(d>"",Sheet1!A2:A20,1/0),2))))
Dynamic array formulas.
 
Upvote 0
If you convert your range to a table and add the heading "Category" you could use the below, it will update if you add in more dates, categories and names:

Hi & welcome to MrExcel.
Another option

Thanks so much for your answers, both of you.
I tried Fluff's option first as I'm not sure what converting the range to a table in my actual document might limit down the line.
Which works great!
Now I'm just wondering if my Name and Category ranges could be non-contiguous as follows:

2023-09-01 04_07_19-Book1 - Excel.png


How would you go about that situation?
Thanks again for your great help so far!
 
Upvote 0
How about
Excel Formula:
=LET(d,VSTACK(Sheet1!A2:F7,Sheet1!A10:F11,Sheet1!A14:F14,Sheet1!A16:F16),e,DROP(d,,1),VSTACK({"Date","Name","Category"},HSTACK(TOCOL(IF(e<>"",Sheet1!B1:F1,1/0),2),TOCOL(e,1),TOCOL(IF(e<>"",INDEX(d,,1),1/0),2))))
 
Upvote 0
How about
Excel Formula:
=LET(d,VSTACK(Sheet1!A2:F7,Sheet1!A10:F11,Sheet1!A14:F14,Sheet1!A16:F16),e,DROP(d,,1),VSTACK({"Date","Name","Category"},HSTACK(TOCOL(IF(e<>"",Sheet1!B1:F1,1/0),2),TOCOL(e,1),TOCOL(IF(e<>"",INDEX(d,,1),1/0),2))))

Hmm, I'm not getting this second one to work.
I had to advance on my actual document to test this, apologies for the delay.
I decided to keep your first suggestion Fluff and thought I'd just reference the original cells below in the depths of the document. That means the data is a formula though (i.e.: =IF(D25<>"",D25,"") )
And now I'm not getting your first one to work either.

=LET(d,CONSOLIDATED!D200:UW259,VSTACK({"Date","Brand","Type"},HSTACK(TOCOL(IF(d<>"",CONSOLIDATED!D1:UW1,1/0),2),TOCOL(d,1),TOCOL(IF(d>"",CONSOLIDATED!C200:C259,1/0),2))))

Any idea what I did wrong?
 
Upvote 0
As the cells are not empty try
Excel Formula:
=LET(d,CONSOLIDATED!D200:UW259,VSTACK({"Date","Brand","Type"},HSTACK(TOCOL(IF(d<>"",CONSOLIDATED!D1:UW1,1/0),2),TOCOL(IF(d<>"",d,1/0),2),TOCOL(IF(d>"",CONSOLIDATED!C200:C259,1/0),2))))
 
Upvote 0
Solution
As the cells are not empty try
Excel Formula:
=LET(d,CONSOLIDATED!D200:UW259,VSTACK({"Date","Brand","Type"},HSTACK(TOCOL(IF(d<>"",CONSOLIDATED!D1:UW1,1/0),2),TOCOL(IF(d<>"",d,1/0),2),TOCOL(IF(d>"",CONSOLIDATED!C200:C259,1/0),2))))
Yes, thank you! That solved it!!
I'll mark this as solved, thanks Fluff!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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