Formulas and Functions
25181 TopicsReturn of the Corkscrew with Spilled Arrays
I'm starting a new topic but do want to refer to PeterBartholomew1 post on accumulators here https://techcommunity.microsoft.com/t5/excel/ways-of-performing-accumulation-with-dynamic-arrays/m-p/2329035 This post was in 2021 and things have or may have moved on since then and I'm wondering if there is an easier way to achieve the following. The Corkscrew. I have seen a number of addins and other 5G functions which do far more than I want. I'm basically looking for a way to break the circularity in a corkscrew and it seems that if I can calculate the top row ie typically the opening balance without referring to the closing balance then all would be good. To add complexity I’m trying to fuse the actuals and forecasts in this single function. I have flags to determine the actuals and can use NOT actuals to get the forecasts (same flags) and can pic up the actual opening balance from the source data easily. As I will calculate all time periods for both I can then just add them (as actuals will be multiplied by the Actual flag and thus zero for forecast periods and vice versa for the forecasts. So I just need to calculate the forecast period which will be the same for the entire array block. The key is. getting the previous value. (for the inflows and outflows as they are already calculated I can just shift their arrays forward I col but adding a column in front to get the previous value so that is easy. I can then get the closing balance by adding the inflows and outflows that would fall in the middle of the corkscrew to this previous value to simulate an opening balance. The inflows and outflows can then be added easily and the closing balance simply summed. So all the clever work would go in the opening balance. The added complexity I have is that I am doing a multi row version. ie there are ‘currently’ 3 entities all with opening balances, all with inflows and outflows and closing balances. I want to calculate these in blocks of these entities – 1 row per entity but in a single dynamic array. But the corkscrew will be made up of 4 dynamic arrays – opening bal, inflows, outflows and closing. If someone has a better logic here then do let me know. I saw Jeff Robsons one from a few years back using sumifs for the middle bit. But again, I want to do these in separate blocks which does add a layer of complexity. The reason is that I can ( have) modelled with multiple entities together rather than separately which means one just needs to extend the blocks (VBA to the rescue as there will be a good number of them) as required and inputs can just be assigned to the respective entity (often locations around the world might just be a tiny rep office with hardly anything going on so no need for a fully blown model but can be detailed separately. I also have the ability to enable or disable entities so they are included or excluded from the calcs. SO back to the problem, Model attached. Blue cells mark the dynamic array function for the block. The inflows and outflows will come from other dynamic arrays. But this idea means that one can expand the middle if the top/bottom are taken care of with regard to the circularity. I’m trying to get something easy to implement ideally in a single function (with or without LET)Solved1.9KViews0likes30CommentsAdvanced Excel Formula discussion - Problem with dynamic range
Let's assume I want to rent a house. For each house, if the landlord has an agent, I'll contact the agent; If not, I contact the landlord directly. As below: Landlord Agent House Landlord James Mary W James Linda Michael X David Y Linda Z James Column F: =IFERROR(XLOOKUP(E2:E5,A:A,B:B,E2:E5),E2:E5) This is correct Column G: =XLOOKUP(E2:E5,A:A,B:B,E2:E5) #VALUE! for X-David Column H: =XLOOKUP(E2:E5,A:A,B:B,CHOOSECOLS(E2:E5,1)) Wrong value for X-David, because it returned the first value in range of XLOOKUP([if_not_found]) field My question is: the only difference between G and H is CHOOSECOLS(). If I put =CHOOSECOLS(E2:E5,1) or =E2:E5 in a separate cell, it gives me same result. However, in XLOOKUP, they are recognized differently. What is the logic behind this? Thank you for spending time on reading this.120Views0likes5Comments- 189Views1like6Comments
How should I write this Process?
I am not sure how to do this in function for without going through a long chain of manual brute force steps and hope I'm in the right discussion group for this. I have hunted the help hits on my search engine, but I'm not even sure if I am asking the right question so I am getting frustrated. The picture below shows where I am now. I want to set up a Function the will roll a d100 x number of times (with individual rolls reported, not added together) with x equaling the row's Chances cell (an assigned value). The 1 and 47 are the established Red/Blue cut offs for a different cell to process (outside this question, but will take suggestions if you have them). Ideally they would display as "81, 28, 42" etc. but I am interested in the function lay out. When it comes to Functions, my knowledge is limited the very basic ones and I am using baby talk when I do use them, so please be kind. Is this even possible or I am I just being crazy/unrealistic?144Views0likes6CommentsData Pulling
I'm trying to figure out the best way to pull data together from multiple tabs within an excel file. The file is made so that it can track issues within reports that are discovered. I'll try to break it down the best I can to explain what I have and what I'm trying to do. Within the file there are 5 tabs that are considered locations and they are named: LX, LV, CR, HR, FL Each tab is set up the same way with the only real important information in these columns of a table Column A - PCR Date Column C - PCR Owner Column G, I, K, M - Modification Category (1-4) these fields are actually drop down options from the Category Master List Within the file there is a 6th tab that has at able in it that is called Category Master List. Column A - Options for the dropdown in the above tab Modification Category columns Column B - Breakdown into one of three main categories (Billing, Compliance, Quality) Now this is what I'm trying to do: Fiscal Year Data (September 2025-August 2026) - I need to see how many times each of the dropdown options within the Master List show up in column G, I, K, M for each of the 5 location tabs. Monthly Data - I need to see how many times each of the dropdown options within the Master List show up in column G, I, K, M for each of the 5 location tabs along with how many times there is an entry with a date within that month. I would like to try and figure out how to put everything into one data table/chart type thing so it's easier to see and compare. Currently, everything needed is across a few different pivot tables and I would really like the data to pull itself automatically instead of me having to go in and copy all the data from one spot into another just to get the pivot results. Below is what I'm having to look at currently.54Views1like1CommentDrop-Down List + IF function
Is it possible to have a drop-down list of cities that once chosen, the sales tax use in % will populate in a separate cell and that cell will multiply to another cell (subtotal) to create a grand total based on the cities chosen on the drop-down list. Many thanks!Solved1.9KViews0likes8CommentsIFS Formula Help
Hello, I have been struggling with a formula and I'm hoping for some insight. I am using it to separate employees and their information to another worksheet based on which school they work for. Their school assignment is notated by either their school name column (K), school code column (AL), or both. This is the formula: =IFS(K2="SCHOOL NAME",XLOOKUP(B2,B:B,E2,""),AL2="SCHOOL CODE",XLOOKUP(B2,B:B,E2,"")) I am trying to use an IFS statement to pull data from one sheet to another if the value meets at least 1 of 2 conditions. The formula seems to stop at the first value, even if the second value is true. That is, if an employee doesn't have a certain school name in column K but has the corresponding school code in column AL, their information is not pulling to the new worksheet. How I would like the formula to work: -Jane Doe has "X Elementary" in column K, then her information from the XLOOKUP will populate into the cell. (The spreadsheet has a lot of information, and I only need a few columns to pull to the new worksheet.) -If not, the formula will continue to search in column AL for the school code. -If the specific school code is found, then her information from the XLOOKUP will populate into the cell. If nothing matches the criteria, then a blank value will be returned. Thank you in advance!Solved88Views0likes2CommentsDependent calculations in tables
Hi all, I'm using a formula to calculate amounts into a master column in budget sheets depending on the currency. I'm pulling currency rates with the stock function into a separate sheet with named cells for each rate that I'm using. My budget table has a "Total" column where I put in the amount, a "Cur" column where I select the currency, and then the master column where it's converted into the currency that I'm working with for each budget. The formula I'm currently using is this: =IFS([@Cur]="EUR";[@TOTAL];[@Cur]="NOK";nokeur*[@TOTAL];[@Cur]="SEK";sekeur*[@TOTAL];[@Cur]="GBP";gbpeur*[@TOTAL];[@Cur]="";) nokeur, sekeur, gbpeur are named cells containing the currency rates. The last argument is only to not get a REF error on empty rows. (Semicolons instead of commas due to my language settings) This has gone through a bunch of revisions over the years and I'm constantly trying to shorten the formula as much as possible. This is the shortest I've managed to get it though. I wanted to check if anyone has any advise on how to make it more elegant. the formula does exactly what I want so it's not a problem per se, it's more out of interest. Also a related topic: sometimes when others are using my sheets, they will mistakenly put values in the Master column, overwriting the formula. This is hard to spot, and ideally I'd like to lock those cells/that column so you can't replace what's there. Locking the workbook can of course achieve this but it also prevents the user from adding additional lines in the table. Is there any smart way to get around this? I've also tried with conditional formatting to clearly highlight the cells if they don't contain a formula but I haven't managed to make it work properly.70Views0likes3CommentsConditional Formatting - red/green based on deadline date
Hello! I am making a spreadsheet to track due dates for selection items for home building. I want to be able to get a quick visual to see how progress is being made. I have it set up so that H4 contains the due date in short date format, then in I4-I10 blank cells for me to input when an item was selected. I have spent the last few hours trying to figure out how to turn the I cells red or green - if the short date entered in the I column is on or before the due date in H4, the I cell will turn green. If the short date entered in the I column is after the due date in H4, the I cell (with the date) will turn red. Does that make sense, and could someone guide me on this? Thanks so much!Solved4.7KViews0likes4Comments