User Profile
PeterBartholomew1
Silver Contributor
Joined 8 years ago
User Widgets
Recent Discussions
Re: Index & Match Formula Not Working
Maybe it was just the 0 missing from the MATCH to required exact matches. With 365 I would use array formulas and truncate entire column references to conform to the actual data. = INDEX(returnArray, XMATCH(TRUE, BYROW(lookupArrays=lookupValues, AND))) or = XLOOKUP(TRUE, BYROW(lookupArrays=lookupValues, AND), returnArray)23Views0likes0CommentsRe: Excel charts: revenue and margins over a time period
I think you need to declare the charts with Switch Row/Column to plot against year. I am also not convinced that there is much to be gained by stacking the column and line presentation within a single chart (see below). Two adjacent charts may well be clearer.14Views0likes1CommentRe: How to create a multi-tiered percentage-based bar chart?
The essential characteristic of the replies you have received is that the data needs to be unpivoted in order to plot it. This can be done using PowerQuery or by formula. = LET( wrapped, WRAPROWS(TOCOL(data),2)/100, name, TAKE(WRAPROWS(TOCOL(IF(data, Tabelle1[Employee])),2),,1), hdr, TAKE(WRAPROWS(TOCOL(IF(data, header)),2),,1), HSTACK(name, hdr, wrapped) ) If you include the attribute names in the chart data then the presentation can be labelled more meaningfully.2Views0likes0CommentsRe: Groupby or Filter function
Your question assumes the statistical analysis is complete and you simply need to reformat them. I was just pointing out the alternative option of performing the statistics in a manner that would output the results you require directly (depending upon the raw data format) = GROUPBY(group, value, HSTACK(AVERAGE, MEDIAN, MODE),,0)16Views0likes0CommentsRe: Automatically convert numbers to time
This is just a slight variation on NikolinoDE 's formula approach. The first step is to allow the 4-digit format you require for data input but use number formatting of "00\:00" to display the number as if it were a time in hours and minutes. You could also use validation to request the input of an integer between 0000 and 2400. The appearance of the number may be OK but as a datetime it is not relevant being a date sometime prior to 27 July 1906. To convert to a time you divide by 100, treat the decimal part as 60ths to get a result in hours and then further divide by 24 to get the time as a proportion of a day. This could be a worksheet formula, in which case you commit a further range to display the times, or you could simply use a defined name inputTime = DOLLARDE(input/100, 60)/24 If you use 'inputTime' to reference the 4 digit times it will return a meaningful array of times. If you have 365 and feel more adventurous you could define a Lambda function to convert the 4-digit integer representation to Excel times Worksheet formula = CONVERT.TIMEλ(input) where CONVERT.TIMEλ = LAMBDA(integerTime, DOLLARDE(integerTime/100, 60)/24) If you never perform calculation using the non-standard representation of time, everything after the first two paragraphs can be ignored.16Views1like0CommentsRe: Groupby or Filter function
Slightly more complicated = LET( pairs, WRAPROWS(TOCOL(data), 2), values, DROP(pairs,,1), WRAPCOLS(values, 4) ) It would also be possible to delete the table and work directly from the source data using GROUPBY along with the rather large array of statistical functions.63Views1like2CommentsPlaying with conditional formatting
This formatting is something I used to restructure the way I wrote formulas between 2015 and 2018. In the original I used VBA but now, as often happens, worksheet formulas used within conditional formatting are sufficient. The formula defining the condition is = DIRECTREFλ(A1) //Function to test for the presence of direct cell references DIRECTREFλ = LAMBDA(cell, IF(ISFORMULA(cell), REGEXTEST(FORMULATEXT(cell), "\b[A-Z]{1,3}\${0,1}\d{1,6}\b")) ); The original was pretty effective as a training aid to avoid the practice of relative referencing and use defined names! That said, not many followed my lead! Mind you when I posted a discussion on Chandoo it didn't meet with overwhelming support, though subsequent events in the form of spilt ranges have made my life so much easier! The post did however stimulate more discussion than I had anticipated. The A1 notation is an abomination that has no place within serious spreadsheet design -- discuss? | Chandoo.org Excel Forums - Become Awesome in Excel211Views1like2CommentsRe: Native FIFO Inventory Costing Function for Excel (Proof of Concept with LAMBDA)
jmarraztoa I suspect that most users' understanding of the options is still constrained by the limitations of the conventional spreadsheet. Your work is interesting. You appear to have used recursion, whereas I used SCAN working over a stacked and sorted array of inputs and outputs. FIFO Lambda in Excel The other difference is that you appear to have experience of FIFO and LIFO calculations whereas I had ideas for the solution but no experience of the problem! I provided an option for selecting the form of presentation by allowing the user to switch between crosstab and list formats but with no specific end use in mind. 😒 Given a function that performs the FIFO calculation, it should be possible to go further, say by using the function within GROUPBY to build an array of functions that would calculate the results for multiple products or distinct geographical regions. Either the entire set of results could be output as an array of arrays, or slicers could be used to down-select. My feeling is that, this far, I have only scratched the surface of what is possible using modern excel.52Views0likes0CommentsRe: Calculate overlapping hours
Hi David That is truly impressive! I probably should have taken it one step further to present the formula as a Lambda function, as you did with GroupOverlapHours. I am coming to think that practically every calculation should be held within a well-documented Lambda function. Your use of GROUPBY to marshal complex calculations is also impressive. Far from being the poor man's equivalent of the Pivot Table, GROUPBY and PIVOTBY appear to have hidden depths that allow them to go well beyond simple aggregations. The use of thunks also presents some interesting choices. In some cases they appear to be used to insert fragments of code for conditional execution; other times it is more a matter of referencing precalculated values held within memory for repeated use.77Views2likes1CommentRe: Calculate overlapping hours
This has a limitation of only addressing data for a single supervisor. = LET( starts, EXPAND(startTimes,,2,1), finish, EXPAND(endTimes,,2,-1), stack, SORT(VSTACK(starts, finish)), headcount, SCAN(0, TAKE(stack,,-1), SUM), event, VSTACK(TAKE(stack,,1), TAKE(stack,-1,1)), duration, DROP(event, 1) - DROP(event,-1), SUM(IF(headcount, duration)) ) It builds a table that has a row for every event (volunteer arrivals and departures) and accumulates the headcount to determine which intervals are paid.134Views1like3CommentsRe: Non-Consecutive Cell Referencing
May I be a bit harsh. In my opinion you are beginning your adventure of learning Excel by focussing upon obsolete techniques, maybe forced upon you by the use of legacy software. In these days of dynamic arrays, the concept of relative referencing an dragging formulas down is over-complicated and confusing! If you wish to reference every 5th element of an 'array', one way of doing it is to wrap the array across 5 cells at a time. wrapped = WRAPROWS(array, 5) You will see the references you require in the first column. To select the column one simply chooses it every5th = CHOOSECOLS(wrapped, 1) These are most useful in situations in which the other columns are used in separate calculations. If they are not used, INDEX will work = INDEX(array, SEQUENCE(n,,, 5)) Putting these together, either by nesting or by using the LET function to define variables every5th = CHOOSECOLS(WRAPROWS(array, 5),1) or (a bit more advanced) every5th = LET( wrapped, WRAPROWS(array, 5), CHOOSECOLS(wrapped, 1) ) every5th = LET( k, SEQUENCE(n,,,5)), INDEX(array, k) ) I am not trying to get at you. It is simple that I believe that you should be encouraged to start your journey by travelling forwards, not back to the past. Maybe the other expert contributors to this discussion have a different opinion.6Views1like1Comment- 13Views0likes0Comments
Re: Please update Excel to handle more than 15 digit numbers!
The limit is determined by the storage allocated to hold a number in a standard IEEE format. There is always a compromise to be struck between the storage demands & processing time required for a calculation, and the accuracy achieved. Some calculations such as the solution of large ill-conditioned systems of simultaneous equations can run into problems but I think it very unlikely that you are concerned with the precision to which numbers are represented. It appears to me that the 'numbers' you wish to manipulate are in fact text strings that happen to based upon the digits 0-9 rather than A-Z. In which case the limit appears to be 32,767 of which 1024 may be displayed as a single row within the cell. This is not a workaround, a credit card number cannot be meaningfully doubled or square-rooted, so text is the appropriate format. The catch is that Excel is like an eager puppy in the way it attempts to convert anything that could be considered as a number in order to perform numerical calculation. SergeiBaklan has shown ways of suppressing this behaviour by setting options. Another approach is to prefix a possible number by a single apostrophe, say when loading the data from VBA. Once Excel is allowed to convert the text to a number the original text cannot usually be recovered and would need to be read once more from the database.19Views0likes0CommentsRe: TOCOL/TOROW Treat Thunks as Errors
I had somewhat resigned myself to the idea that I couldn't use the TOCOL error criterion to filter errors without also taking out the #CALC! errors that represent functions. I now think I was wrong to settle for that! As you have observed, ISERROR does not treat functions as errors so why should TOCOL? In a functional programming environment in which functions are first class citizens it is simply wrong that TOCOL should treat them as errors.37Views0likes0CommentsRe: Return of the Corkscrew with Spilled Arrays
Hi James I am not sure why this reappeared in my feed, especially since it is marked as a solved problem! However, this time I have attached a possible solution using a complicated form of the SCAN function that works with array of array problems. My intention is that SCANHλ helper function should be reasonably easy to incorporate into a model. The core element of the financial models I have seen, is the Lambda function that addresses a single period within the model and, knowing the opening balances, calculates the closing balances. Being a single period, model circular references are avoidable. This function may be used within SCAN (or a generalisation of SCAN) to calculate the closing balances for the entire model. Closing balances are brought forward to form opening balances, here using B∕Fwdλ. Once they are known the entire model can be calculated and presented as a single array calculation. The catch with going so far into array manipulation is that the flow of the calculation is best read from the formulas rather than by examining cells on the worksheet. That will ruffle many feathers.34Views1like4CommentsRe: Advanced Excel Formula discussion - Problem with dynamic range
This may not be of much assistance for your current challenge but there are no issues with using defined names in conjunction with dynamic arrays. A defined name is simply a name given to a snippet of code that, when used within a worksheet formula will execute to formula to which it refers. The most widely used defined names refer to simple range references, e.g. fixed range = $A$1:$B$40 in which case you have an absolute range reference. However, it is quite possible to name the anchor cell of a dynamic range, in which case using the name followed by the # operator is the dynamic range. An alternative is to define the name to refer to the dynamic range by including the # within its definition. anchor = Sheet1!$A:$1 Worksheet formula = anchor# or dynamicRange =Sheet1!$A$1# Worksheet formula = dynamicRange returns a reference to the same range. Not only that, but finalRow =TAKE(anchor#,-1) is a reference to the final row of a dynamic range and will move up and down the sheet as the data changes. Please accept my apologies if this is obvious to you, but it is likely that there will be other users that have never had cause to explore the possibilities.15Views1like0Comments
Recent Blog Articles
No content to show