Auto populate individual cells based off cell values from data table with NO VBA

Stomli

New Member
Joined
Jun 22, 2023
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Hi Forum,

This is my first time posting. I am usually able to find my answer to other questions by looking through the forums but I haven't been able to find an answer for this issue I'm having. So I am reaching out to the experts on here. Please and Thank you!

I need to auto populate dates for specific users based on cell values inside a table. I would like to implement them with dynamic array formulas so this can scale and update based on new reports. Also, I can't do this with macros or VBA since the end users can't work with them.

First thing I would need to know is how I would go about is how to make duplicate cells based on values (numbers) in a cell. I have been looking up some nested If functions, but I am not sure how they could work for a multiple month table with blanks in them.

The other thing I need is a method on how to tie these duplicate cells to a unique user I.d. while omitting blank fields for months without changes. I was thinking after the duplication if figured out that a sequence formula could just drag the duplicated dates down and use a filter() formula to match them to the right division.

I could develop the back end in a helper column/tab. If this is too difficult for one direct solution, please suggest methods or formulas that I could use to solve this.
1687471676655.png

Thanks for your time.

S
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hello @Stomli .

Welcome to the MrExcel forum. Please accept my warmest greetings and sincere hope that all is well.


Try the following formulas.

In cell B8:
Excel Formula:
=MID(CONCAT(REPT(B3:B4,MAP(C3:N4,LAMBDA(m,m)))),SEQUENCE(SUM(C3:N4)),1)
1687535813504.png


In cell D8:
Excel Formula:
=LET(a,C3:N4,--MID(CONCAT(REPT(C2:N2,MAP(a,LAMBDA(m,m)))),5*(SEQUENCE(SUM(a))-1)+1,5))
1687535826892.png


I attached the images so you can see the result.


--------------
Let me know the result and I'll get back to you as soon as I can.
Cordially
Dante Amor
--------------​
 
Last edited:
Upvote 1
Also, I noticed the Mid was based off of one character. What would I need to look into for a 3 character division name?
But all must be 3 characters.
Excel Formula:
=LET(a,C3:N4,MED(CONCAT(REPETIR(B3:B4,MAP(a,LAMBDA(m,m)))),3*(SECUENCIA(SUMA(a))-1)+1,3))

---- *** ----
Since the dates are going to be tied to the user ID, is there a way to ensure that the user ID corresponds to the date and the division (the division is a lookup based on the user ID)?
You should show me how those IDs are.
The formula obtains the data of the dates and the divisions from left to right and from top to bottom.

---- *** ----

Could you provide a brief breakdown of how these 2 formulas particularly how the Mid, Concat, Rept, and Sequence tie into each other?
Of course.
If with the formulas before MS365 there were several solutions to the same problem, now with the new MS365 formulas, the number of solutions for the same problem has increased considerably.

I explain my solution, maybe there are more solutions, maybe simpler or more complicated, but this is how I tried to solve it.

I have to tell you that I have barely 2 months of using a version of 365 that is in the cloud and the functions come in English and Spanish, add that it is a slightly different Spanish from the one I usually use in the functions. In fact it is the first time that I use the LAMBDA and MAP functions.

---- *** ----
how the Mid, Concat, Rept, and Sequence tie into each other?

I will explain using an example of 3 months:

1687561156407.png
In this case, with the MAP function, I am passing the matrix from C3 to E4 to the LAMBDA function, which in this case does not require doing anything to the matrix, I only need it to return the matrix but applying to each data in the matrix the REPT function:

So in the example cell C3 has a 1, it means that the data in cell B3 is going to be repeated 1 time.
Cell D3 has a 3, it means that the data in cell B3 is going to be repeated 3 times.
Look in the following image how the division is repeated the number of times it appears in the matrix.

1687561482488.png

The CONCAT function concatenates all the results on a single line. This is the option I found. Maybe there is another solution.

Now the difficult thing is to separate each division in a cell vertically.

1687561949909.png

To separate the string into rows I use the MID function, this function needs the initial position, for that I use the sequence function, which will give us position 1, 2, 3 and even the total number of characters in the string, how many are? the sum of the numbers in the range C3:E4; and the last parameter of the MID function is the number of characters to take from the string, in this case the division is 1.

1687562367167.png

---- *** ----


I hope the explanation helps you.
Cordially
Dante Amor
--------------​

 

Attachments

  • 1687561788532.png
    1687561788532.png
    10.6 KB · Views: 7
  • 1687563619301.png
    1687563619301.png
    22.4 KB · Views: 7
Last edited:
Upvote 1
Solution
I don't understand your 2nd request. How about this for the first?

062023 Misc.xlsm
BCDEFGHIJKLMN
2DivJanFebMarAprMayJunJulAugSepOctNovDec
3A020010100400
4B000300020000
DateChg
Cell Formulas
RangeFormula
C3:N4C3=SUM((--($B$8:$B$20=$B3))*(--MONTH($D$8:$D$20)=COLUMN()-2))
 
Upvote 0
kweaver, I think the portion you gave formulas for is being hard coded in. I think Stomli wants to generate the table below with the table above. I've already tried and reverted to PowerQuery to at least get something that works.

But I'm sure they want a formula do generate at least the date column, but probably the division column as well. Haven't been able to get a formula to work yet.
 
Upvote 0
Thanks for your explanation Irobbo314. Yes, that is what I want for the dates column the division is a xlookup that already links the IDs So I don't need any help on that column but I need to get the dates to follow downward from the top of the user id. So I need 2 Feb dates for the 1st 2 users then a May date for the next user. I would need to input these 1 after the other taking into account the months that don't have any dates in them and also the division for each user Id.
 
Upvote 0
Also sorry for the screenshot. My company has my excel locked down so I can't get the add-in.
 
Upvote 0
With several helpers, this does it, I think...but it's a little more effort than really desired.
I haven't figured out a LET function for it or another shorter way.

This might temporarily get you over a hump if there's not too much to handle.

062023 Misc.xlsm
BCDEFGHIJKLMN
1123456789101112
2DivJanFebMarAprMayJunJulAugSepOctNovDec
3A020010100400
4B000300020000
5
6
7DivUserDateAB
8A2/1/202422123414
9A2/1/202415322844
10A5/1/2024174564
11A7/1/2024410578
12A10/1/20249108
13A10/1/202410
14A10/1/202410
15A10/1/202410
16B4/1/2024
17B4/1/2024
18B4/1/2024
19B8/1/2024
20B8/1/2024
DateChg
Cell Formulas
RangeFormula
C1:N1C1=SEQUENCE(,12)
D8:D15D8=DATE(2024,I8#,1)
F8:F11F8=TRANSPOSE(FILTER(C3:N3,C3:N3<>0))
G8:G11G8=TRANSPOSE(FILTER(C1#,$C$3:$N$3<>0))
I8:I15I8=XLOOKUP(SEQUENCE(SUM(F8#)),H8:H12,G8:G12,,-1)
J8:J9J8=TRANSPOSE(FILTER(C4:N4,C4:N4<>0))
K8:K9K8=TRANSPOSE(FILTER(C1#,$C$4:$N$4<>0))
M8:M12M8=XLOOKUP(SEQUENCE(SUM(J8#)),L8:L10,K8:K10,,-1)
L8,H8L8=1
L9:L10,H9:H12L9=L8+J8
D16:D20D16=DATE(2024,M8#,1)
Dynamic array formulas.
 
Upvote 0
Hi @Stomli

I updated the formulas and images:

In cell B8:
Excel Formula:
=MID(CONCAT(REPT(B3:B4,MAP(C3:N4,LAMBDA(m,m)))),SEQUENCE(SUM(C3:N4)),1)

Or like this, so you only have to change a range of cells.
Excel Formula:
=LET(a,C3:N4,MID(CONCAT(REPT(B3:B4,MAP(a,LAMBDA(m,m)))),SEQUENCE(SUM(a)),1))


1687536281214.png



In cell D8:

Excel Formula:
=LET(a,C3:N4,--MID(CONCAT(REPT(C2:N2,MAP(a,LAMBDA(m,m)))),5*(SEQUENCE(SUM(a))-1)+1,5))

1687536388937.png




--------------
Let me know the result and I'll get back to you as soon as I can.
Cordially
Dante Amor
--------------​
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,640
Messages
6,125,972
Members
449,276
Latest member
surendra75

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