excel
6290 TopicsBuilding Agent Mode in Excel
Excel is the world’s most trusted canvas for working with data, powering everything from household budgets to Fortune 500 companies, scientific research, operational planning, and classroom learning. It’s where millions turn to think, plan, and build. Agent Mode takes that impact even further, unlocking expert-level capabilities and making advanced analysis, modeling, and automation approachable for everyone, across every domain. Agent Mode lets you describe a task in natural language and then works with you to plan, reason, iterate, and validate the outcome. After introducing Copilot in Excel, it quickly became clear that our users wanted more — richer insights and more direct action on the sheet. Agent Mode aims to deliver on these expectations with a resilient experience that works across domains and data shapes, taking meaningful action directly in your workbook. We’ve developed Agent Mode to take advantage of the full richness of Excel artifacts, including table structures, formula syntax, dynamic arrays, PivotTables, charts, and more. It can create workbooks that are refreshable, auditable, and verifiable. This leap is powered by advances in our reasoning engine and the deeper expression of Excel as a rich modeling language. These breakthroughs allow Agent Mode to not only generate and execute solutions but also evaluate results, fix issues, and repeat the process until the outcome is verified. SpreadsheetBench instructions and obtained an accuracy rate of 57.2%. In our testing environment, Agent Mode makes direct workbook modifications via Excel APIs in a JavaScript runtime. We measure accuracy using the script provided by the SpreadsheetBench authors that grades output using the open-source openpyxl library. For evaluation on Claude and Shortcut.aI, we manually ran the SpreadsheetBench tasks (including answer location information needed for reliable evaluation) and downloaded the Excel files that were produced. These downloaded files were then graded using the same evaluation script provided by the SpreadsheetBench authors. Note that our evaluation with Claude completed on 895 of 912 instructions. Accuracy numbers were calculated using only completed tasks. All OpenAI benchmark results were originally published by OpenAI here. We measure Agent Mode on both our internal evaluation sets and the public SpreadsheetBench benchmark. Our results on SpreadsheetBench place Agent Mode at the leading edge of current systems, accurately completing 57.2% of the benchmark’s tasks. But we want to be clear: we don’t optimize for benchmarks, we optimize for real user jobs in Excel. That means solving messy, ambiguous, and complex tasks that reflect how people actually work. And while SpreadsheetBench is a strong signal, it doesn’t capture everything that makes Excel powerful — like dynamic arrays, PivotTables, charts, and formatting — or the customer need for refreshable, auditable, and verifiable solutions. That’s why we have also developed internal evaluation sets, AI grading, and user feedback loops to guide improvements. We also acknowledge that we have plenty of room for improvement, particularly around things like formatting and presentation-worthy layouts. But we believe our foundation is strong, and the direction is clear: Agent Mode is here to make Excel more powerful, more intuitive, and more helpful than ever before. Designing an Intelligent Spreadsheet Agent At the center of Agent Mode is a reasoning and reflection loop — powered by the latest generation of advanced reasoning models — that can interact directly with Excel workbooks. Rather than jumping straight into action, our system generates model-ready context from a given workbook and leverages an advanced reasoning model to begin planning for a given task. The system then interacts with the workbook by writing and executing code to carry out that plan, reflecting on the results, and evaluating whether the outcome matches the intent. If gaps remain, the loop continues: revising the strategy, pulling in additional context, and exploring alternative approaches. This cycle of planning, execution, and reflection continues until the system determines the task is complete. By combining planning with reactivity, the agent can chart a path, adjust when needed, and ultimately deliver solutions that feel intentional and well thought out. The reasoning engine of our system architecture is model-agnostic by design, allowing for rapid integration of new models as they become available. Loose coupling between our reasoning and workbook interaction layers allow us to quickly swap in and evaluate new models. Managing spreadsheet context Excel workbooks are living systems. They're often large, constantly changing, and filled with rich objects like PivotTables, slicers, and charts. For an agent, trying to absorb every detail all at once is simply impractical. Passing the entire dataset into context, along with the metadata for every object, would overwhelm any current model. Even exposing the thousands of read APIs Excel provides is far too heavy-handed. Instead, the agent approaches the workbook strategically: it pulls in just the pieces of context it needs, when it needs them, navigating the complexity step by step. This makes the agent not just a passive processor of data, but an active explorer of your workbook’s inner workings. To enable this selective exploration, we’ve developed a document context producer that operates within a coordinated push-and-pull system. On the push side, the document context producer proactively sends a compact “blueprint” of the workbook along with the user’s prompt — a summary of spatial layout, values, objects, and the formula dependency graph — encoded as JSON for complex objects and Markdown for tabular data. When deeper inspection is required, the reasoning engine can then request and pull additional information on demand, ensuring it can always operate with the context it needs. This hybrid design balances completeness with efficiency and lays the foundation for future improvements around caching, indexing, and search that will make context retrieval faster and more robust. Engineering domain knowledge of Excel Managing context gives the agent a clear view of the workbook. The next challenge is action: knowing which of Excel’s thousands of functions and APIs to call to get the job done. Excel spans thousands of API controls, including formulas, objects, and advanced features — a surface far too large for any current model to memorize or control directly. Instead of brute-forcing that complexity, we built distilled documentation into our reasoning engine — a compact, structured reference of Excel functions, objects, and specialized tool calls. Agent Mode can draw on this distilled knowledge to execute sophisticated tasks like building PivotTables, charts, slicers, and financial models. By embedding only the essential information, the model gains expert-level fluency in Excel’s internal workings without overwhelming its context window, enabling accurate reasoning across the full feature set of the application. Validation-driven generation In developing and evaluating our core coding and reflection loop, we observed that many spreadsheet errors are silent — formulas return values, but subtle mistakes remain hidden until they cascade into bad analysis. Relying on a single execution step is risky when the goal is trustworthy automation. To counter this, Agent mode in Excel reframes each tool call as an auditable, verifiable workflow. Before executing an action, our reasoning engine first generates lightweight tests to establish expected outcomes. These checks act as verifiable guardrails, ensuring that each step can be inspected and reproduced. Crucially, rather than hardcoding values, Agent Mode carries out all computations directly on the grid. This preserves the full dependency structure of the spreadsheet, allowing users to audit intermediate results, trace formulas, and verify correctness at every stage. Across our quantitative evaluations, we have been able to drive double-digit accuracy improvements with this validation-infused approach. Scaling quality with AI graders As we evolve Agent Mode into a deeply integrated, context-aware companion for data workflows, AI graders have emerged as one of the most critical technical enablers driving quality, trust, and usability. They serve not only as evaluators of accuracy but also as definers of excellence—ensuring that results are not just correct, but also useful, complete, relevant, and delightful. Graders are the mechanism through which we translate abstract quality goals into measurable, actionable standards. In Agent mode, they underpin both offline evaluation pipelines and live user experience metrics, helping us answer key questions like: Did Agent Mode fulfill the user’s intent? Was the output accurate and verifiable? Did the result feel native to Excel? Was the experience satisfying and accessible? Without graders, we would risk optimizing for superficial metrics — like response time or token count—while missing the deeper signals of user success. Looking ahead An early preview of Agent Mode in Excel is available starting today via the Frontier program for Microsoft 365 Copilot licensed customers and Microsoft 365 Personal, Family, or Premium subscribers (under the Microsoft Services Agreement). Agent Mode works in Excel on the web and is coming soon to desktop. To try it, look for Agent Mode in the Tools menu of Copilot in Excel. Learn more about it in our announcement blog. This preview is just the beginning of our journey. We’re continuing to build a complete, M365 integrated experience that is trustworthy, reliable, and transparent — one that you can depend on for critical work. And from a developer perspective, we’re exploring extensibility solutions that would allow customers and partners to build custom solutions on top of our Agent Mode capabilities. Over the coming weeks and months, we plan to fully integrate and iterate on this experience across all Excel clients. We’ll continue to improve core output quality, refine the Agent Mode interfaces in chat and on the grid, and incorporate user feedback to ensure the experience feels at home in Excel, while unlocking entirely new ways to model, analyze, and automate.15KViews16likes2CommentsImport data from a Microsoft Forms PDF into Excel
Hi all. I have a number of PDFs for clients which contain questionnaires, score sheets, etc. Some are completely external, and some are from Microsoft Forms. A while back, I created a Macro/some VBA code to read data from the external PDFs, import it into Excel and display the figures; it works really well. Today, I've tried to update it to load data from the PDFs created by "printing" a Microsoft Forms complete questionnaire and saving as a PDF - unfortunately, when trying to import this into Excel (using "Get Data -> From File -> PDF"), the "Likert" questions are appearing but showing "null" for all the columns, not identifying which contains the "selected" checkbox. Possibly a slim hope, but I was wondering if anyone has experience doing something similar, or can recommend a way to get this to work? I know there are potentially other ways to approach this (I tried connecting it directly to the linked Sharepoint Excel file, but the URL is entirely powered by URL arguments ?foo=bar&baz=boing etc, and Excel demands those all be deleted when giving it a filename to connect to to get data from the web, helpfully); connecting it to a "local" version of the Excel file on OneDrive is a possibility, but ideally I'd a) want the tool to be accessible to people who have access to the PDFs but not the spreadsheet, and b) have to save the print-out PDFs in every client folder to store their data together, and the spreadsheet may occasionally be purged, so the PDF is the "safe" way to access the data.) PDFs can't be run through any online tools due to containing sensitive data. Many thanks.21Views0likes1Comment- 39Views0likes1Comment
Excel: Count cells with specific value + colour
Hi there, I would like to be able to count the number of cells that contain a specific value and are shaded a specific colour. This is for a rota spreadsheet that will be tallying the total number of shifts which have been agreed. The cells that contain "Yes" as a value from a drop down list and are shaded green, should be counted as part of the quarterly total. I'm assuming that a VBA custom function would be needed for this. I've tried a few but cannot figure out a way to get this to work with both a specific value and colour. I would be very grateful for anyone that is able crack this challenge. In the example screenshots, it is the cells shaded in green that would need to be counted and the totals appear in column GJ. Best regards, Daniel214Views0likes7CommentsThe Diagonal Suite: Gentle thunking goes a long way!
I've become a big advocate for gentle thunking - using thunks to delay eager evaluation wherever possible in generalized Lambda development. The timings are quicker and the logic is cleaner. On the other hand, thunking the results of MAP, BYROW, or BYCOL - especially when it leads to rows of thunks - tends to introduce recombination overhead and complexity. I think thunking is often dismissed as “too complex,” and that’s understandable if someone’s first exposure involves unwrapping a row of thunks. When used gently thunking becomes indispensable. Typically, I introduce the thunks after the initial benchmarking to see the difference in the calculation times and the after is always quicker. To illustrate, I’ll share The Diagonal Suite - a collection of functions where thunking is used at every opportunity. Simple, clean, deferred logic. What are your thoughts on gentle thunking? Where have you found it helpful/harmful in your own Lambda development? //The Diagonal Suite - Version 1.0 - 10/27/2025 //Author: Patrick H. //Description: Directional traversal and diagonal logic for 2D arrays. // Functions: // • Traverseλ - Directional traversal engine // • ByDiagλ - Diagonal-based aggregation // • DiagMapλ - Wrapper for diagonal matrix extraction // • DiagIndexλ - Targeted diagonal extraction // • Staircaseλ - Construct diagonal staircases from a vector or 2D array //──────────────────────────────────────────────────────────── //------------------------------------------------------------------------------------------- //Traverseλ - Directional Axis Remapper //------------------------------------------------------------------------------------------- //The selected axis is remapped to the top-left traversal order. //Accepted directions: // "NE" or 1 → Northeast (↗) // "SE" or 2 → Southeast (↘) // "SW" or 3 → Southwest (↙) //Parameters: //array → 2D input array (scalars not accepted) //new_axis → Axis direction ("NE", "SE", "SW" or 1–3) Traverseλ = LAMBDA( array, new_axis, //Input validation IF(OR(ROWS(array)=1,COLUMNS(array)=1), "#2D-ARRAY!", IF(AND(ISNUMBER(new_axis),OR(new_axis<=0,new_axis>3)),"#AXIS!", LET( //Dimensions i, ROWS(array), j, COLUMNS(array), //Axis traversal indices (deferred) x_NE, LAMBDA(SEQUENCE(j,,1,0)*SEQUENCE(,i)), y_NE, LAMBDA(SEQUENCE(j,,j,-1)*SEQUENCE(,i,1,0)), x_SE, LAMBDA(SEQUENCE(i,,i,-1)*SEQUENCE(,j,1,0)), y_SE, LAMBDA(SEQUENCE(i,,j,0)+SEQUENCE(,j,0,-1)), x_SW, LAMBDA(SEQUENCE(j,,i,0)+SEQUENCE(,i,0,-1)), y_SW, LAMBDA(SEQUENCE(j,,1)*SEQUENCE(,i,1,0)), //Axis mode selection mode, IF(ISNUMBER(new_axis),new_axis, SWITCH(new_axis,"NE",1,"SE",2,"SW",3,1)), //Index selection x, CHOOSE(mode,x_NE,x_SE,x_SW), y, CHOOSE(mode,y_NE,y_SE,y_SW), //Unwrap indices and get results result, INDEX(array,x(),y()), result ) ))); //------------------------------------------------------------------------------------------- //ByDiagλ - Diagonal-based aggregation //------------------------------------------------------------------------------------------- //Apply an ETA function or Lambda to diagonals //Parameters: //array → 2D input array (scalars not accepted) //[function] → ETA function or Lambda applied to diagonals //[row_wise_stack?] → Optional: Display results as a vertical stack ByDiagλ = LAMBDA( array, [function], [row_wise_stack?], //Check array input ValidateDiagλ(array,,function,row_wise_stack?, LET( //Optional parameters No_Function, ISOMITTED(function), No_row_wise_stack,ISOMITTED(row_wise_stack?), //Dimensions i, ROWS(array), j, COLUMNS(array), //Diagonal count k, MIN(i,j), //Indices - deferred r, LAMBDA(SEQUENCE(k)*SEQUENCE(,j,1,0)), y, LAMBDA(SEQUENCE(k)+SEQUENCE(,j,0,1)), c, LAMBDA(IF(y()>j,NA(),y())), //Unwrap indices, shape, and aggregate result, IFNA(INDEX(array,r(),c()),""), shaped, IF(No_row_wise_stack,result,TRANSPOSE(result)), final, IF(No_Function,shaped, IF(No_row_wise_stack,BYCOL(shaped,function), BYROW(shaped,function))), final ))); //------------------------------------------------------------------------------------------- //DiagMapλ - Wrapper (Calls ByDiagλ) to extract diagonals as 2D matrix //------------------------------------------------------------------------------------------- //Calls ByDiagλ to extract the diagonals from a 2D array. //Parameters: *Please see ByDiagλ for descriptions.** DiagMapλ = LAMBDA( array, [row_wise_stack?], ByDiagλ(array,,row_wise_stack?) ); //------------------------------------------------------------------------------------------- //DiagIndexλ - Targeted diagonal extraction //------------------------------------------------------------------------------------------- //Extract a diagonal or anti-diagonal vector from a 2D array. //Parameters: //array → 2D input array (scalars not accepted) //col_index → Column number to start from. Negative = anti-diagonal DiagIndexλ = LAMBDA( array, col_index, //Input checks ValidateDiagλ(array,col_index,,, LET( //Dimensions i, ROWS(array), j, COLUMNS(array), //Diagonal direction: +1 = SE, –1 = SW s, SIGN(col_index), //Determine diagonal length based on bounds k, IF(s>0, MIN(i, j + 1 - col_index), MIN(i, ABS(col_index))), start, IF(s<0,ABS(col_index),col_index), //Indices - deferred x, LAMBDA(SEQUENCE(k)), y, LAMBDA(SEQUENCE(k,,start,s)), //Unwrap indices and extract vector deliver, INDEX(array,x(),y()), deliver ))); //------------------------------------------------------------------------------------------- //Staircaseλ — Construct diagonal staircases from a vector or 2D array //------------------------------------------------------------------------------------------- //Parameters: //array → Input array (flattened to vector row-wise) //block_size → Number of rows/columns per staircase block //[block_offset] → Optional padding between staircases //[IsHorizontal?] → Optional toggle for column-wise orientation //[IsAntiDiag?] → Optional toggle to display staircase anti-diagonal. Staircaseλ = LAMBDA( array, block_size, [block_offset], [IsHorizontal?], [IsAntiDiag?], //Check inputs ValidateStaircaseλ(array,block_size,block_offset, LET( //Check optional parameters no_Block_Offset, ISOMITTED(block_offset), zero_Offset, block_offset=0, col_offset, IF(No_Block_Offset,0,block_offset), IsVertical?, ISOMITTED(IsHorizontal?), Not_Anti_Diag, ISOMITTED(IsAntiDiag?), //Convert to vector and get dimensions flat, TOCOL(array), k, COUNTA(flat), seq, LAMBDA(SEQUENCE(k)), V, TOROW(EXPAND(WRAPROWS(seq(),block_size),, block_size+block_offset,0)), width, COLUMNS(V), //Anchors and indices - deferred i, LAMBDA(SEQUENCE(block_size)*SEQUENCE(,width,1,0)), col_arr, LAMBDA(IF(Not_Anti_Diag,SEQUENCE(,width), SEQUENCE(,width,width,-1))), j, LAMBDA(MOD(col_arr(),block_size+block_offset)), j_, LAMBDA(IF((no_Block_Offset)+(zero_Offset), IF(j()=0,block_size,j()),j())), idx, LAMBDA(IF(i()=j_(),V,NA())), //Obtain results, shape, and calculate result, DROP(IFNA(INDEX(flat,idx()),""),,-col_offset), final, IF(IsVertical?,TRANSPOSE(result),result), final ))); //---------------------Error Handling & Validation--------------------------- //Validates inputs for Staircaseλ. Please see Staircaseλ for parameter //descriptions. ValidateStaircaseλ = LAMBDA( array, block_size, [block_offset], [on_valid], LET( //Checks NotArray,TYPE(array)<>64, Invalid_block_size, OR(ISTEXT(block_size),block_size<=0,block_size>COUNTA(array)), Invalid_block_offset, OR(ISTEXT(block_offset),block_offset<0), //Logic gate IF(NotArray, "#NOT-ARRAY!", IF(Invalid_block_size, "#BLOCK-SIZE!", IF(Invalid_block_offset,"#BLOCK-OFFSET", on_valid)))) ); //---------------------Error Handling & Validation--------------------------- //Validate inputs for ByDiagλ, DiagMapλ, and DiagIndexλ. //*Please see those functions for parameter descriptions.* ValidateDiagλ= LAMBDA( array, [col_index], [function], [row_wise_stack?], [on_valid], LET( //---Checks--- //Array input IsArray?, TYPE(array)=64, Not_Array, NOT(IsArray?), //Col_index No_Col_Index, ISOMITTED(col_index), Col_Index_Included, NOT(No_Col_Index), Not_Valid_Col_Index?, NOT(AND(col_index<>0, ABS(col_index)<=COLUMNS(array))), //Function No_Function, ISOMITTED(function), Function_Included, NOT(No_Function), Invalid_Function?, AND(ISERROR(BYROW({1,1},function))), //Shaping input RowWiseStack?, NOT(ISOMITTED(row_wise_stack?)), //Deterine which function is being validated DiagIndex, Col_Index_Included, ByDiag, AND(No_Col_Index, Function_Included), DiagMap, AND(No_Col_Index, No_Function), //Logic gates //DiagIndexλ a, IF(Not_Array, "#NOT-ARRAY!", IF(Not_Valid_Col_Index?,"#COLUMN-INDEX!", on_valid)), //ByDiagλ b, IF(Not_Array, "#NOT-ARRAY!", IF(Invalid_Function?, "#FUNCTION!", on_valid)), //DiagMapλ c, IF(Not_Array, "#NOT-ARRAY!", on_valid), //Logic gate selection decide, IF(DiagIndex,a, IF(DiagMap,c, IF(ByDiag,b, "#UNROUTED!"))), decide )); //End of The Diagonal Suite - Version 1.0 //Author: Patrick H.27Views0likes0CommentsHelp Needed: Add Interactive Dashboard to Landowner Engagement Tracker (Same Sheet)
Hi all, I’ve built a basic Excel tracker to monitor engagement with landowners for a large infrastructure project. The purpose of the tracker is to: Show progress tracking of each case of for the project director to monitor progress help the Project Director Identify which cases may require statutory powers to secure access (if voluntary agreement isn’t possible) This helps our leadership team make informed decisions quickly. What I’ve got: A sheet called "LANDS RIGHT TRACKER" Columns include: Reference Number Agreement Status Case Status Risk Level (High/Medium/Low) Willingness to enter agreement Reason for refusal Flag for whether statutory powers may be needed 🛡️ All data is fictitious — names and details are placeholders, so no privacy concerns. What I need help with: my level of excel knowledge is very basic and I was hoping for some assistance to: Add an interactive dashboard and key metrics directly on the same sheet (not a separate worksheet). The below is just my suggestions as you are the expert your guidance expertise is much welcomed, happy for you to put it straight on to the tracker as I have left a section on the tracker for you to insert your items Ideally using a Pivot Table and Slicers to filter by: Case Status Risk Level Agreement Status Willingness to enter agreement https://docs.google.com/spreadsheets/d/1c2IJ-YLsTN-DZE9ltw0JR-nGVuuGzTKE/edit?usp=drivesdk&ouid=104511246399228274463&rtpof=true&sd=true34Views0likes1CommentFormula in Excel Spreadsheet not work
Hi Sir, Picture 1 shows the desired condition, where the row of the spreadsheet turns orange when the SPT (N) is more than 50. However, it will not work where the SPT (N) at row 47 become 0. All rows below row 48 become orange colour as picture 2. https://mega.nz/folder/g5dizZqR#7Pk7eyU0hXZTL6sj3qVJ-g. We attach the file in follows link for your further action. Thanks.54Views0likes1Comment