User Profile
PeterBartholomew1
Silver Contributor
Joined Sep 26, 2018
User Widgets
Recent Discussions
Re: Calculating and adding time
Based upon OliverScheurich workbook but using 365 formulas. delay = ROUND(distance*correction, 0) startTimeSec = 24*60*60*raceStart + delay# startTime = raceStart + delay#/(24*60*60) intervals = startTime# - DROP(VSTACK(raceStart, startTime#),-1) startNumber = SCAN(1, SIGN(intervals#), SUM)7Views0likes0CommentsRe: Looking for help with a single Dynamic Formula Ranking Points by player and dropping lowest score
This is a 'prettied up' version of the above that defines a Lambda function for the calculation. Worksheet formula = SUMMARISEλ(name, place) where SUMMARISEλ = LAMBDA(name, place, LET( JOINλ, LAMBDA(x, TEXTJOIN(",", , SORT(x))), header, {"Total points", "Finishes"}, points, INDEX(pointList, place), GROUPBY( name, HSTACK(points, place), VSTACK(HSTACK(SUM, JOINλ), header), 0, 0,-2 ) ) );0Views0likes0CommentsRe: Looking for help with a single Dynamic Formula Ranking Points by player and dropping lowest score
A formula approach that works is to use =GROUPBY( name, HSTACK(points, place), VSTACK( HSTACK(SUM, LAMBDA(x, TEXTJOIN(",", , SORT(x)))), {"Total points", "Finishes"} ), , 0,-2 )4Views0likes1CommentRe: Technical Question: Is a Range argument passed to SUM as a Reference or an Evaluated Array?
I suspect you need a member of the development team to know for sure or, otherwise someone like Charles Williams who regularly codes in conjunction with Excel. My expectation is that the range A1:B5 remains as a reference until you take some action to force it to convert. For example = SUM(0+$E$5:$F$16 $D$8:$G$11) still performs the array intersection before the summation. OFFSET will also pass overlapping range references around if required to do so.78Views1like0CommentsRe: Correlation Study with Filters
I can create tables of correlations but I am not sure about the tables of charts! =LET( datasetsϑ, BYCOL(SNR, THUNK), MAKEARRAY( 3, 3, LAMBDA(i, j, LET( SNR_x, INDEX(datasetsϑ, 1, i + 1)(), SNR_y, INDEX(datasetsϑ, 1, j)(), r, IF(i >= j, CORREL(SNR_x, SNR_y), ""), r ) ) ) )60Views1like0CommentsRe: Data Formatting
anupambit1797 UNPIVOT.CSVλ is simply a defined name I used to reference the Lambda function. The MAPλ helper function is posted on my GitHub repository https://gist.github.com/pbartxl/a14b250985da31be843ce9ff35d888fc What it does is to allow the in-built MAP function to return arrays of arrays (without introducing additional lambda functions to reference the inner arrays you would be limited to arrays of scalars which is not that much use)! OliverScheurich Since I found myself implementing unpivot functionality it would probably have made sense to consider a more overt database strategy! 😆24Views0likes0CommentsRe: Data Formatting
To be honest, I am not sure whether this 365 solution will be of any value to you, it uses specially written versions of MAP to overcome the array of array problem in Excel 365. The problem-specific formulas are Worksheet formula = MAPλ(Table1[sfn], Table1[RNTI], Table1[DCI], UNPIVOT.CSVλ) where UNPIVOT.CSVλ = LAMBDA(sfn, RNTI, dci, HSTACK( EXPAND(sfn, COUNTA(TEXTSPLIT(RNTI, , ",")), , sfn), TEXTSPLIT(RNTI, , ","), TEXTSPLIT(dci, , ",") ) ); The catch is the function MAPλ that I published on GitHub is not straightforward, though it may be easy enough to use.2Views2likes2CommentsRe: unpivot data and handle merged cells without using Power Query (Unpivot_Toolkit)
Looks impressive! A useful step towards providing new calculation options. My first choice might be to use array formulas directly on the data objects held within your crosstab The next might be to use your 'souped up' unpivot followed by database-style aggregations Repivot to form a new crosstab with the restructured arrays for calculation Choice is good.69Views1like1CommentRe: Looking for help with a single Dynamic Formula Ranking Points by player and dropping lowest score
Just to demonstrate it is always possible to make a solution more complicated! Worksheet formula = RANKEDλ(Name, Finishes) // RANKEDλ calls SCOREλ by player then sorts results descending RANKEDλ = LAMBDA(name, finishes, LET( pts, MAP(finishes, SCOREλ), SORTBY(CONCATENATE(name, ": ", pts), pts,-1) ) ); // SCOREλ converts finishes into a point score SCOREλ = LAMBDA(fin, LET( places, DROP(REGEXEXTRACT(fin, "\d+", 1),,-1), SUM(INDEX(points, VALUE(places))) ) );4Views0likes0CommentsRe: Filter Function or TAKE-DROP Function
Hi Matt I do not think we have, as a community, fully embraced the use of either arrays of functions or functions of arrays (thunks in particular). In this instance the use of thunks does not especially simplify things. My worksheet formula was = LET( dataϑ, BYROW(data, THUNK), list, GROUPBY(file, dataϑ, TOPANDTAILλ, 0, 0), rowHdr, TAKE(list,,1), bodyϑ, TAKE(list,,-1), return, HSTACK(rowHdr, EVALTHUNKARRλ(bodyϑ)), return ) This is, turn each row of the data into a single object. Define a function TOPANDTAILλ that stacks the first and last row horizontally. Strip off the file names and convert the list of thunks back to an array using EVALTHUNKARRλ. If one is going to build solutions as arrays of thunks, it would be useful to have a built-in function that stacks the evaluated thunks. TOPANDTAILλ = LAMBDA(group, THUNK( HSTACK( (@TAKE(group, 1))(), (@TAKE(group,-1))() ) )); The function works by evaluating the first and last thunks in the list before stacking them horizontally and returning the stacked row as a thunk. It would have been far simpler had the tick counts and slots been returned in pairs, The functions that form and extract data from arrays of thunks can be found at https://gist.github.com/pbartxl/a14b250985da31be843ce9ff35d888fc4Views0likes0CommentsRe: XLOOKUP search w/multiple output
Much the same as NikolinoDE =IF(ISTEXT(OnChNum), "("&OnChNum&")", XLOOKUP(part, oldNumber, OnChList)) =IF( ISTEXT(OnChNum), XLOOKUP(OnChNum, OnChList, description), XLOOKUP(part, oldNumber, description) ) The only other thing I would suggest is that if both the OnCh and part numbers are present you use conditional formatting to hide the part number. The conditional format would test the OnCh entry but apply number formatting of the form "---" to the part number entry.51Views0likes3CommentsRe: Weekday only calendar
= MAPλ(months, CALENDARλ) CALENDARλ = LAMBDA(monthIdx, LET( monthStart, DATE(year, monthIdx, 1), mGrid, SEQUENCE(6,7,FLOOR(monthStart,7)), cleanMonth, IF(MONTH(mGrid)=MONTH(monthStart), DAY(mGrid), ""), monthTxt, TEXT(monthStart, "MMM"), weekdays, {"Mon","Tue","Wed","Thu","Fri"}, days, EXPAND(DROP(cleanMonth,,2),6,6,""), VSTACK(monthTxt, weekdays, days) ) ); This is based upon the m_tarler solution. I set out to conform to the approach of only one formula per sheet so wanted the year calendar as one formula.50Views1like0CommentsRe: Formual Error
This reply was based upon a copy of the IlirU dataset and generates the result crosstab shown in yellow. = LET( TOP3λ, LAMBDA(s,t,IF(@s>=LARGE(t,3), @s, 0)), crosstab, PIVOTBY(Attendance, DATEVALUE("1/"&Month), Point, TOP3λ,,0,,0), nonblank, BYROW(DROP(crosstab, , 1), OR), FILTER(crosstab, nonblank) ) The Lambda function TOP3λ returns a scalar '@s' if it is one of the top 3 values within the overall list of points 't' for the month, 0 otherwise. Blank rows are then filtered out.36Views1like0CommentsRe: Excel Challenge - Pivoting poorly structured data
Some amazing solutions! All of which serve to demonstrate that Excel has moved lightyears from where is used to be. How long before such solutions are overtaken by AI, I have no idea. Mind you, that may be where I delete 365 from my computer and find other interests. You never know though. It is strange to think that mathematical notation was developed to overcome to ambiguity of natural language and here we are hell-bent on reversing the process.66Views1like0CommentsRe: Loss carry forward for limited years
Patrick2788 "Typical arrangement" ... I doubt it! I have attached a file that contains a possible layout for a single product line. The file was used to support an on-line presentation so it is more focussed upon demonstrating solution techniques than attempting the most efficient solution for each problem. The message being that a dynamic array solution in Excel may have very little in common with the traditional spreadsheet!55Views0likes0Comments- 57Views0likes0Comments
Re: What is the SERIES function?
The final parameter is simply a sequence number defining the order in which the series are stacked on the chart. The user experience offered by the SERIES command is somewhat different from other functions because it is not processed by the Excel calc engine but, rather, by a distinct charting engine (this is my understanding, not official documentation I have at hand). Change the data series in a chart - Microsoft Support83Views0likes0Comments
Recent Blog Articles
No content to show