The databases that I use at work are created by a macro that automatically includes a couple of calculations beneath the data that calculate the change over the month and the annual change. This data gets updated on a monthly basis, so the cell reference where the calculations occur shifts downwards by 1 row per month (e.g. when we have data for March 2022 this would be added in row 15 and the monthly change calculation would shift down to row 17). The screenshot below is a rough example of the structure that the data is in (as I can't show you the actual data...)
I want to be able to create a range that finds the max/min of the values within the database without including any of the calculations (as some of these are likely to fall below the minimum value). This means that I can't just simply calculate the max/min for the entire column. For example, if I want to find the maximum of Var X, I can use the following equation to find the maximum within the range of B2:B14
=MAX(B$2:INDEX(B$2:B$1048576,MATCH(MAX($A$2:$A$1048576),$A$2:$A$1048576,0),)).
The problem is that using INDEX in this way causes the function to return #REF! if the database spreadsheet is closed when I open up the spreadsheet that this formula is saved in. Ideally I would like to find a function that can fulfil the same purpose without requiring the database spreadsheet to be open. Is anyone aware of a function that could be used to achieve the same result?
I have also tried a combination of INDIRECT and CONCAT, but this also returns the same #REF! error
Related
hello dear forum members and admins,
i created a dashboard to calculate customer numbers based on raw data prepared on day and time set.
there is no problem here I can calculate. but I also want to calculate the monthly average customer numbers based on the time set. for this purpose, I created a data table in a daily_pax_sheet. for e.g in January between 10:00 - 10:30 CUSTOMERS E totally number is 35 and this 35 amount occurred in 8 days, then it calculates 4 amounts. in daily_pax_details sheet row 107 formula firstly calculate sum of the data then it divides the day number (for e.g this amount occurs in 8 days) but in some cases, raw data include more than 20k line and it's calculating and waiting too much. is there any other way to do it in a quick way ? how can I change this formula to make calculation quick ?
https://docs.google.com/spreadsheets/d/1y-2Ke2ssskzSM-wYszU54CIEraPbEX4X/edit#gid=459027650
UPDATE: thanks for the idea and solution from members
I also realized another solution and I think it will help other people in the future. we can get the data to the pivot table with counting the unique values with changing field settings. To do it you should get the data pivot table with selecting "add this data to the data model". then changing value field settings with the "Distinct value". hope it will help another pppl.
Your SUMIFS formulas use whole columns as criteria, so every calculation checks more than 1 million cells. And because you use more than 1 column, then every time you update *anything in the file, Excel checks more than 4 million cells because of your formulas...
I changed all to use the righ rawdata range of cells used, not whole columns. And now it works perfect.
As example, your formula is:
=SUMIFS('raw data'!$R:$R;'raw data'!$D:$D;'Daily customer'!C$3;'raw data'!$I:$I;'Daily customer'!$A4)
And I changed to:
=SUMIFS('raw data'!$R$2:$R$2461;'raw data'!$D$2:$D$2461;'Daily customer'!C$3;'raw data'!$I$2:$I$2461;'Daily customer'!$A4)
Because in your sheet raw data your data goes from row 2 to 2461, so in every calculation Excel checks only 2460 cells, not 1 million....
Change all your formulas like this and you should notice a better performance indeed.
UPDATE: I've uploaded the modified file: https://docs.google.com/spreadsheets/d/11isonBHFJTFFWtZTJg66JHbtyrD0XFGl/edit?usp=sharing&ouid=114417674018837700466&rtpof=true&sd=true
It works smoothly for me. No lag or anything. I can change any cell value, move the graph, filter cells and everything is done almost instantly.
So I am attempting to create a static table in Excel that functions dynamically based off of a pivot table. The amount of data is manageable, ~200-300 rows, so having the formulas wrapped in IFERROR to keep them blank is not an issue. The issue I am running into is identifying the row number that the subtotal's are populated in. They are split by client but the number of entries can very month to month so this month the subtotal for client A could be row 46, but next month it could be row 52. The data is needed from the subtotal line to perform additional calculations within the "static" table.
So far I have been able to concat the row function, which correctly identifies that there is 1 row containing the data.
=ROWS(CONCAT(VLOOKUP(G47,Table1[[CWShortID]:[Company Name]],2,FALSE)," ","Total"))
However, I am unable to pull back the row number itself (which I need to concat into another formula).
Essentially I am attempting to use a short id to pull the clients full name from another table, concat it with " Total" to form the search parameter, return the row number of the match, then concat that with a column identifier to perform the intended calculation. Example:
=SUM(I47/IF(COUNTIF($A$52,CONCAT(VLOOKUP(G47,Table1[[CWShortID]:[Company Name]],2,FALSE)," ","Total"))=1,$B$52,""))
Basically in the above I need both "52"'s to be dynamically populated by the function. Reading Microsoft's documentations ROW() appears to be what I am looking for, but when nesting it doesn't work as intended.
=SUM(I47/IF(COUNTIF(CONCAT("A",ROW(CONCAT(VLOOKUP(G47,Table1[[CWShortID]:[Company Name]],2,FALSE)," ","Total"))),CONCAT(VLOOKUP(G47,Table1[[CWShortID]:[Company Name]],2,FALSE)," ","Total"))=1,CONCAT("B",ROW(CONCAT(VLOOKUP(G47,Table1[[CWShortID]:[Company Name]],2,FALSE)," ","Total"))),""))
Anyone ever been able to do this without having to write in VBA routines or functions? I would prefer to stick strictly with Excel formulas.
I have a spreadsheet that provides monthly results for the last year. The layout is 7 columns per month, each column is the same information for each month (count and rate of various things).
I need to trigger a true/false based on both count and rate being above threshold values in any of the twelve months.
I can do this using either nested IFs or just a lot of IF statements, but was wondering if anyone has a better suggestion? I am open to formulas or VBA, whatever would be most robust.
Image of how each month is arranged
It's a little hard to tell from your spreadsheet what the layout is, but I tried to recreate it (See image below). I entered the function =IF(OR(B2>0.04,C2>2),$A$2) into cell A7 and dragged it across the spreadsheet. All the values you're looking for should be under the Month column. To prevent the function from changing its reference to the first column Name, I used absolute referencing, with dollar symbols $A$2. This way you don't have to keep changing it back to the specified column. Hope this helps.
I have a table in an Excel workbook that I'm using to manage a budget for various accounts. Every month I want the budget to increase by some small percentage. I've built a simplistic demo of that I need at Calculate monthly budget increase
Here's a screenshot of it:
I basically need a formula that increases the budget every month, per account, by adding a given percentage (in cell B1) to the previous month. Note, not interested in using VBA. This has to be done with a formula.
Hope that makes sense. Suspect I haven't explained myself very well.
Using an Excel Table for this is an unfortunate decision, because in a table you'd typically have the same formula applied to the whole column. In your case it looks as if that will not be the case, since some rows have values manually entered and you seem to want the empty cells to contain formulas.
You can use this formula starting in cell F3
=F2+(F2*$B$1)
Copy and paste to all empty cells in the column.
I have a Table in Excel that contains yearly usage data for some products. For example, I have Product A with usage stats from 2003 to 2014. The table is referenced via several Named ranges to be used in formulas. Usage_Product is the column name of the products, Usage_Year is the Year, and Usage_Grand_Total is the total for all months in that year.
I have a basic data chart built using formulas that key off of a Named cell reference called YearSelected. The cell contains a list of years, allowing the user to select the Year they want to see usage for. The following formula works fine when the year is selected:
=SUMIFS(Usage_Grand_Total,Usage_Product,A3,Usage_Year,YearSelected)
A3 is a reference to a cell that contains the specific product name that matches the Table data.
However, I would like to get a sum that includes all prior years instead of just the one selected. I tried the following formula (and variations of it) without success:
=SUMIFS(Usage_Grand_Total,Usage_Product,A3,Usage_Year,"<"&YearSelected)
This returns 0 for some reason. Even if I do "<"&2014 or "<2014", I get the same 0. I do a lot of similar types of formulas, but this one has me stumped. The basic goal is to have a running summary of usage for the start of each selected year. Any ideas on using the right formula option?