Forum Discussion
Excel Journal Entry Automation
- May 29, 2025
unfortunately it requires a login:
but the good news is that it does appear you have excel 365 since it isn't giving a name? error.
I also wanted to ask what that 'Sub' column was for since it is 000 in each case (at least in the example). It might be easier if we could make a single formula to spill all 3 columns (or all 4 and include the 'Sub' column)
EDIT: I think I found the issue. In my sample I have the CC column as numbers which match the numbers in row 1 of the Activity retrieve sheet. But I think you have them as TEXT. if you convert those text values to numbers or vice versa the numbers to text it should work. Alternatively we can update the formulas to force both to text (or numbers):
column E:
=MID(FILTER('Activity retrieve'!D:D, ('Activity retrieve'!B:B=Sheet2!D2)*(N(CHOOSECOLS('Activity retrieve'!F:J,XMATCH(Sheet2!B2&"",'Activity retrieve'!$F$1:$J$1&"")))<>0),""),3,9)
column G:
=IF(E2="","",LET(c,CHOOSECOLS('Activity retrieve'!F:J,XMATCH(Sheet2!B2&"",'Activity retrieve'!$F$1:$J$1&"")),o,FILTER(c, ('Activity retrieve'!B:B=Sheet2!D2)*(N(c)<>0),""), q,-12,p,CHOOSE(SIGN(o)+2,HSTACK("",-o),{"",""},HSTACK(o,"")),p))
in the updated attached file I include these formulas and also a version that has all 4 columns spill:
=LET(c,CHOOSECOLS('Activity retrieve'!F:J,XMATCH(Sheet2!B10&"",'Activity retrieve'!$F$1:$J$1&"")), r,XMATCH(1,('Activity retrieve'!B:B=Sheet2!D10)*(N(c)<>0)), ac,MID(INDEX('Activity retrieve'!D:D,r),3,9), v,INDEX(c,r), p,CHOOSE(IFNA(SIGN(v)+2,2),HSTACK(ac,"000","",-v),{"","000","",""},HSTACK(ac,"000",v,"")), p)
so it first picks the column,
then finds the row (r)
based on the row it finds the AC and the value (v)
then p just creates the 4 cell output.
this could also be wrapped into a larger LAMBDA using either stacking in a REDUCE function or using THUNKS but for now lets just get this part working
https://dpdhl-my.sharepoint.com/:x:/r/personal/mitchell_smith2_dhl_com/Documents/Desktop/Apr-25%20Network%20WC%20Calculation%20File%20(Condensed).xlsx?d=wed2c2668b1bb478eb7eea18339046999&csf=1&web=1&e=0iFAFY
This link should work to a condensed version of the workbook.
The sheet names are correct as far as I can tell.
There should only be one, the retrieve will consolidate entries made against the same combinations.
unfortunately it requires a login:
but the good news is that it does appear you have excel 365 since it isn't giving a name? error.
I also wanted to ask what that 'Sub' column was for since it is 000 in each case (at least in the example). It might be easier if we could make a single formula to spill all 3 columns (or all 4 and include the 'Sub' column)
EDIT: I think I found the issue. In my sample I have the CC column as numbers which match the numbers in row 1 of the Activity retrieve sheet. But I think you have them as TEXT. if you convert those text values to numbers or vice versa the numbers to text it should work. Alternatively we can update the formulas to force both to text (or numbers):
column E:
=MID(FILTER('Activity retrieve'!D:D, ('Activity retrieve'!B:B=Sheet2!D2)*(N(CHOOSECOLS('Activity retrieve'!F:J,XMATCH(Sheet2!B2&"",'Activity retrieve'!$F$1:$J$1&"")))<>0),""),3,9)
column G:
=IF(E2="","",LET(c,CHOOSECOLS('Activity retrieve'!F:J,XMATCH(Sheet2!B2&"",'Activity retrieve'!$F$1:$J$1&"")),o,FILTER(c, ('Activity retrieve'!B:B=Sheet2!D2)*(N(c)<>0),""), q,-12,p,CHOOSE(SIGN(o)+2,HSTACK("",-o),{"",""},HSTACK(o,"")),p))
in the updated attached file I include these formulas and also a version that has all 4 columns spill:
=LET(c,CHOOSECOLS('Activity retrieve'!F:J,XMATCH(Sheet2!B10&"",'Activity retrieve'!$F$1:$J$1&"")),
r,XMATCH(1,('Activity retrieve'!B:B=Sheet2!D10)*(N(c)<>0)),
ac,MID(INDEX('Activity retrieve'!D:D,r),3,9),
v,INDEX(c,r),
p,CHOOSE(IFNA(SIGN(v)+2,2),HSTACK(ac,"000","",-v),{"","000","",""},HSTACK(ac,"000",v,"")),
p)
so it first picks the column,
then finds the row (r)
based on the row it finds the AC and the value (v)
then p just creates the 4 cell output.
this could also be wrapped into a larger LAMBDA using either stacking in a REDUCE function or using THUNKS but for now lets just get this part working
- MitchellithMay 29, 2025Copper Contributor
Yes! Using your first suggestion it works great with the exception of if they are supposed to populate next to each other. Seems the formula will spill into the row below for some reason.
Notes:
-Row 30 will not normally exist, I added to show what the formula is pulling-You may ignore rows 10:13 & 18:25 as those are pulling from a separate retrieve and different from our current project
With this exception everything appears to be pulling in great. Formulas in row 29 below:
Column E:
=MID(FILTER('Activity retrieve'!D:D, ('Activity retrieve'!B:B='APR-25 Unbillable Entry'!D29)*(N(CHOOSECOLS('Activity retrieve'!F:J,XMATCH('APR-25 Unbillable Entry'!B29&"",'Activity retrieve'!$F$1:$J$1&"")))<>0),""),3,9)
Column G:
=IF(E29="","",LET(c,CHOOSECOLS('Activity retrieve'!F:J,XMATCH('APR-25 Unbillable Entry'!B29&"",'Activity retrieve'!$F$1:$J$1&"")),o,FILTER(c, ('Activity retrieve'!B:B='APR-25 Unbillable Entry'!D29)*(N(c)<>0),""), q,-12,p,CHOOSE(SIGN(o)+2,HSTACK("",-o),{"",""},HSTACK(o,"")),p))
EDIT: I see what you were mentioning about the formula needing to pull in multiple ATs if it is under the same CC and ACT, that is what's causing the spill. Do you have a suggestion to work around this?
If not honestly this is very workable and if I see a spill error, all I would need to do is insert a line, copy/paste the line above, and delete after the entry is made.