formulas and functions
25234 TopicsExcel Challenge - Pivoting poorly structured data
This is from an ExcelBI challenge. I thought it may be worth while posting my solution here as a demonstration of modern Excel methods. Challenge Like many of such challenges, the natural solution approach is to use BYROW but that creates the usual 'array of arrays' error. Solution: Gradually I am moving to a point at which I have no formulas showing in the workbook other than calls to Lambda functions. In this case, the worksheet formuloa is = PIVOTBYCATEGORYλ(OrderTbl) The function works row by row apportioning the amounts against the listed categories PIVOTBYCATEGORYλ // Groups and pivots table by category = LAMBDA(table, LET( normalised, BYROWλ(table, APPORTIONλ), // Identify fields from normalised table dimension, TAKE(DROP(normalised,,1),,2), category, TAKE(normalised,,1), partCost, TAKE(normalised,,-1), // Pivot by category return, PIVOTBY(dimension, category, partCost, SUM,,0,,0), return ) ); The function APPORTIONλ divides the amount between categories so each record within the source data returns a number of rows APPORTIONλ // Splits by category and assigns costs = LAMBDA(record, LET( category, TOCOL(REGEXEXTRACT(INDEX(record,4),"\w+",1)), amount, INDEX(record,3) / COUNTA(category), year, YEAR(INDEX(record,1)), region, IF(LEN(INDEX(record, 2)), INDEX(record, 2), "Unknown"), broadcast, B∕CASTλ(HSTACK(region, year, amount), category), return, HSTACK(category, broadcast), return ) ); /* FUNCTION NAME: B∕CASTλ DESCRIPTION: Broadcasts the terms of a vector over the shape of a second array */ B∕CASTλ = LAMBDA(vector, array, IF({1}, vector, array)); The key to making the formula work is the function BYROWλ that I wrote to generalise the inbuilt but over-restrictive BYROW function. The PIVOTBY function returned the required crosstab from the normalised data array0Views0likes0CommentsRandom Contractor Selection List
Hi, I would like to set up an automated random contractor list for tender purpose - is this possible? For example, I have Contractor 1 - Contractor 10, I would like to choose 2 contractors for each tender/quotation request randomly. Currently, it is done manually which is time consuming and could not ensure impartiality in selection - if I can setup the contractor rota to generate random selection, it would be wonderful. Please can anyone advise and help with the correct way to setup my excel sheet? Many thanks26Views0likes3CommentsBank recon matching
Happy New Year everyone! Can someone please assist me with this to a matching exercise for a bank reconciliation. Tried to do XLOOKUP with REGEXTEST but no luck. Below is the link to the excel file. https://1drv.ms/x/c/80b0e5c8d40a83ef/IQAn2IxiOBDpSJBIIZCfPj3TAexy2EEPYT5VjpDkcpTzpB4?e=S4NEuo92Views0likes3CommentsChange in return of AVERAGE function - Mac Excel
I was puzzled that a spreadsheet I use daily generated an error today that had not existed in earlier versions. Attempts to confirm the validity of the spreadsheet functions by running prior versions that had previously run error free resulted in the same error. Eventually, it seems that the operation of the AVERAGE function has been changed in an Excel program update that was installed yesterday. Previously, if an AVERAGE function addressed a range of empty cells, it would return a zero value. Now it is returning the error #DIV/0! This is strange because the AVERAGE function will now return zero if the addressed range contains zeros rather than just being empty. Not sure if Microsoft intended this change or if the change might also apply to other functions. In muy case, I'm able to change my spreadsheet to provide for this but it would have been nice to have some warning.25Views0likes0CommentsSummary sheet, copy entire row if a cell criteria is met
https://arengio-my.sharepoint.com/:x:/g/personal/melanie_stokes_areng_io/IQC2OhPfZnKEQL6qfPj11gqfAQSh8Em3Zp95fkYbLBTZc3g?e=oNU1pEHi Can you please help me, I have a schedule for jobcards, each tab is a book that is given to someone, if that specific jobcard is invoices, then in column T where it says "Incomplete", I want that entire row to be copied to the "Outstanding Jobcards"tab. As a new book is handed out, a new tab is create and the tab is named according to the book sequence. This is updated daily as jobcards are being invoiced.40Views0likes2CommentsTop n vs. Others in Excel
Hi all, I'm seeking some help because I'm kind of new to the more intermediate stuff in Excel. I have an Excel table with the following columns: Subcategory in column A, Brand in column B, Region in column C, Year in column D and Values Month in column E. I want to create a PivotTable and a Pivot line chart from this PivotTable that ranks the Top 5 Brands vs. Other Competitors by each region. For added context: There are 5 subcategories, 3 regions and 25 brands. Currently, I've tried grouping the remaining 20 brands as "Other Competitors" vs. the Top 5 brands within a selected region and possibly all regions (when no selection is made). I'm seeking a solution similar to this... Please mind the colours. I will sort those out later. But, the problem that I'm faced with is that upon selection of a region, the PivotTable won't update to the Top 5 brands of a selected region because they've already been grouped. How can I make this more dynamic so that I'm able to show The Top 5 brands vs. Others? Please help. EDIT: My operating system is Windows 10 (64-bit) and I use Excel 365 (Desktop version). For reference, I've attached a link to a sample file. https://1drv.ms/x/c/b2d878e32a062614/IQC1wcnwLICcQasOfnGcwKn0ASjpXp9xQ6rjnOP10Jal5cc?e=HaXEWd Thank you all once again.Solved277Views2likes11CommentsHelp with Excel Sorting
Hello! I am looking for help with sorting data on a sheet with form responses to different excel sheets. I want to filter by column G to different sheets ("Near Miss", "Adverse Event", "Sentinel Event". The data automatically goes to sheet1 via form responses, but I am trying to streamline the data into specific types of events. I'm using office 365. TIA!52Views0likes2CommentsPeople data lookups
Hi, I have created an MS Form where anyone can nominate their peers for recognition - we have 20k employees. I've added a field in the form for a unique employee number for the nominator to include. So they would submit the nominee's: emp number, full name, role, area of the business. The output comes to me in excel and I need to update a list of 00's of employees, where they work, their contact details, line manager detail etc. The challenge is this: whilst I can do all the look-ups to the external data to provide this, the output of the form could have numerous errors. First of all, a missing emp number or incorrect emp no. Second of all, incorrect name spelling, or shortened names, or duplicate names, or too many spaces etc. Then there's incorrect role or missing role, and finally the same for area of the business. Using either multiple IFs or look-ups or Power Query, what's the best solution to pull through the correct emp number (from my external data), when those first four fields could be all wrong, partly wrong, missing or all correct, and what about dealing with duplicate names? I can concatenate if the four fields are correct, but this isn't reliable. Is there a fuzzy match that takes the best guess at the four fields completed - leaving me to just check a handful of #N/As? I have Copilot and licence too. Thanks!109Views1like3CommentsHelp with data and visuals
I hope i can explain this right, i have data that shows 3 things: person, start date and end date: now i need excel to take this information and represent it as the following in the month tracker: It would look for the charts and figure out the timeline and add them to a row with the timeframe: example is Booy 15-0ct-25 to 23-oct-25 the char would go to the next one and add his information, I hope someone can help me. I just need it to populate the month tracker, Thanks187Views0likes4Comments