excel
43464 TopicsNative FIFO Inventory Costing Function for Excel (Proof of Concept with LAMBDA)
Excel currently lacks a native function to calculate FIFO (First-In, First-Out) inventory costs when products are purchased at different unit prices and later issued in partial quantities. FIFO costing is a standard accounting requirement under IFRS and is widely used in inventory management, retail, manufacturing, and financial reporting. Today, Excel users must rely on VBA, Power Query, or complex multi-step formulas, which are error-prone and difficult to maintain. As a proof of concept, I created a native Excel implementation using modern functions such as LAMBDA, LET, SCAN, MAP, and dynamic arrays. The function calculates the FIFO unit cost of the latest outgoing inventory movement, given: an array of incoming quantities • an array of unit costs for each incoming batch • an array of outgoing quantities While this demonstrates that FIFO costing is feasible using native Excel functionality, the level of complexity required highlights a clear feature gap. A built-in FIFO inventory costing function would significantly improve usability, readability, performance, and accessibility for non-technical users. I believe a native function such as FIFO.COST() or INVENTORY.FIFO() would be a valuable addition to Excel, alongside potential support for LIFO and weighted average costing methods. I’m sharing this example to illustrate both the feasibility and the need for native inventory costing functions in Excel. =LAMBDA( InQty, UnitCost, OutQty, LET( PrevOutQty, TAKE(OutQty, ROWS(OutQty)-1), LastOutQty, INDEX(OutQty, SEQUENCE(1,1,ROWS(OutQty))), OutIndex, ROWS(OutQty), RemainingFromPrevious, LET( InMatrix, InQty, OutMatrix, PrevOutQty, ApplyFIFO, LAMBDA(InMatrix, OutMatrix, LET( n, ROWS(OutMatrix), RecursiveFIFO, LAMBDA(self, Remaining, i, IF( i > n, Remaining, self( self, LET( OutAmount, INDEX(OutMatrix, i), CurrentStock, Remaining, Consumed, VSTACK( OutAmount, TAKE( SCAN( OutAmount, CurrentStock, LAMBDA(acc, qty, IF(qty > acc, 0, acc - qty) ) ), ROWS(CurrentStock)-1 ) ), IF(CurrentStock > Consumed, CurrentStock - Consumed, 0) ), i + 1 ) ) ), RecursiveFIFO(RecursiveFIFO, InMatrix, 1) ) ), ApplyFIFO(InMatrix, OutMatrix) ), FirstRemaining, SCAN( LastOutQty, IF(OutIndex = 1, InQty, RemainingFromPrevious), LAMBDA(stock, qty, IF(qty >= stock, 0, stock - qty) ) ), SecondRemaining, VSTACK( LastOutQty, TAKE(FirstRemaining, ROWS(FirstRemaining)-1) ), FIFOQuantities, MAP( IF(OutIndex = 1, InQty, RemainingFromPrevious), SecondRemaining, LAMBDA(stock, qty, MIN(stock, qty)) ), FIFOUnitCost, SUMPRODUCT(FIFOQuantities, UnitCost) / LastOutQty, IF(ROWS(InQty) = 1, UnitCost, FIFOUnitCost) ) ) Have a nice day. Juan Miguel Arraztoa29Views1like2CommentsUsing mode with several criteria
Hello everyone! I'm currently treating some data before I send it to do some machine learning. I have the following data: id Ano mês data_inversa dia_semana horario uf br km municipio causa_acidente tipo_acidente classificacao_acidente fase_dia sentido_via condicao_metereologica tipo_pista tracado_via uso_solo ano pessoas mortos feridos_leves feridos_graves ilesos ignorados feridos veiculos And I created a new table to summarize this data for months instead of accidents, here are the columns: BR KM Ano Mês Clima (Moda) Tipo Pista Acidentes Veículos Ilesos Feridos Leves Feridos Graves Mortes Causa (Moda) Risco What I want to do is calculate the mode of condicao_metereologica for each combination of BR, KM, Ano and Mês. But I can't wrap my head around on how I could do this. Any help is appreciated! Let me know if I made anything not as clear as it is in my head xD35Views0likes1CommentData Reconciliation Assistance Needed – Time Range & Sum Matching
I have two sets of data that need to be reconciled. Specifically, I’m trying to identify which combinations of numbers from these datasets can sum up to a specific target value. Additionally, the reconciliation should only consider entries that fall within a defined time range—from approximately 8:00 AM on one day to 10:00 PM the following day. I’ve tried using Solver and Goal Seek, but the results don’t seem accurate. I also attempted using Microsoft Copilot, but the outcome still appears incorrect. Could you assist with identifying or generating the correct combinations based on the criteria above?113Views0likes2CommentsWelcome to the Excel Community
The Excel Community is a place we've built for all of you. You can learn more about how to do something with Excel, discuss your work, and connect with experts that build and use the product. With over half a billion Excel customers, we want to engage with you in fundamentally different ways and the community is a starting point for that. Our community helps answer your product questions with responses from other knowledgeable community members. We love hearing feedback and feature requests from you which helps us build the best version of Excel ever. If you have found an outage or a bug please post at our Answers forum. We look forward to getting to know you! Sangeeta Mudnal & Olaf Hubel on behalf of the Excel Team63KViews29likes83CommentsNon-Consecutive Cell Referencing
Hi, folks. I'm attempting to create a spreadsheet that contains links from consecutive cells to consecutive cells in another worksheet that are separated by 5 intervening cells. I'll call the original consecutive spreadsheet "Orig" (for original). So, I know that if I put "='Orig'!A3" in cell B3 and then copy that down, it will update the relative formula consecutively, i.e. B3='Orig'!A3, B4='Orig'!A4, B5='Orig'!A5, B6='Orig'!A6.... that much I get. What I need to do is find a way to do the same thing, but to increase the resulting link.....so that if I copied the formula down column B I would get: B3='Orig'!A3, B8=Orig'!A4, B13='Orig'!A6', etc so that the new worksheet is moving down 5 cells relative to the Orig sheet consecutive order. I've read where someone used a formula using the INDIRECT function but that's beyond my beginner level. Many thanks, and merry Xmas to all!Solved208Views0likes16CommentsCan't print this document! Print preview not matching Page Layout or Page Break Preview
I'm trying to "print" this to PDF, but can't get all my tables and graphs to fit nicely when printing This is my view in Page Break Preview This is my view in Page Layout This is the Print Preview screen, I think when it's scaling the rows to fit on one page, it's not scaling the graphs as well so they keep moving around. How do I make this look nice when I print? I have 16 tables with graphs plus a footer, so they aren't going to fit all on one page, that's why I set it to print over 4 pages.Solved51Views0likes2Commentsname manager rejecting lambdas
I tried pasting a lambda in name manager but excel refused. I belive that it's because either it is too long (which it isnt) or it has too many optional parameters (8). Anyone knows why name manager will reject to paste my lambda? These are the parameters: =LAMBDA(array,slice1,[index1],[return_index_slice2],[index2],[return_index],[if_not_found],[logic],[headers],[function],LET(...))34Views1like2CommentsCalculate overlapping hours
Hello, I need to report how many hours a staff member supervised one or more volunteers. For a very simplified example, Volunteer Name Date Start Time End Time Supervisor Fred 1/1/26 1:00pm 3:00pm Lucy Ethel 1/1/26 2:30pm 4:30pm Lucy Here 4 volunteer hours were served, but because there was a 30 minute overlap, Lucy only supervised for 3.5 hours. Is there a way to get Excel to calculate that? To say: look at all the entries with matching date and matching supervisor, and add up non-overlapping time. I'm not expecting this to be possible, but I thought I'd ask. Thanks!Solved231Views1like12CommentsFind average with checkboxes
Hello, I’m not fluent in Excel but I do alright. Currently I am having a real hard time figuring this out. I’m trying to pull averages from different cells to one cell but based on if a box is checked. Backstory: I track times in a task and get the averages for each person but also the store average. As some people are no longer in those roles or now doing part time, I want the store average to only show the data from the people I choose. Ex: cell I3 is the store average. I only want it to account for the data in cell C11 if the checkbox in D10 is checked. I only want it to account for the data in cell G11 if the checkbox in cell H10 is checked. And so on and so forth. I have tried: =IF(D10,C11,IF(H10,G11)) =AVERAGEIF(D10,”TRUE”,C11(H10,”TRUE”,G11)) =AVERAGEIF(D10,”TRUE”’C11)&AVERAGEIF(H10’TRUE”,G11) but none of those have worked.47Views0likes2CommentsUsing a combination of IF Statement and LET function
Hello, I am trying to do the following from the attached link: If the Fiscal period date in Col B (of the SORTED_INV_CN worksheet) is greater than/equal to Dec 2025 or less than April 2025 then type in "Ignore" Else, use the LET function to lookup by Invoice# in the LookUp-Comment worksheet However, the function in Cell D2 of the SORTED_INV_CN worksheet is returning "Ignore" for all the rows in Column D. At the end of the day, I am required to evaluate the xlookup function for date range less than Dec 2025 and April 2025. I am partial to the LET function as it reduces the need to add a 2nd xlookup formula. The LET function works without the parent IF function but is returning erroneous data as soon as I incorporate the IF(OR( function. Here is the link to the file: https://docs.google.com/spreadsheets/d/1oiWWXXOSorZuB5Q4vzgdHO_kyRkvGE3L/edit?usp=drive_link&ouid=103354753371375324640&rtpof=true&sd=true I think the problem lies in the way the date format is being interpreted between the evaluation cells. Hope you can point me in the right direction. Thank you. Regards, Shams.28Views0likes2Comments