I'm trying to write an averageifs statement based on multiple criteria in dropdown boxes, referencing data in a separate sheet that connects to an ETL query. please ignore criteria in cell D8, and E31-34 is where i need to write the forumlas.
[Dropdown]
[Data]
Formula for D31:
=AVERAGEIFS(Data!O:O,Data!A:A,D5,Data!C:C,D8,Data!B:B,D11,Data!H:H,D17)
Formula For D32:D34 (drag down):
=AVERAGEIFS(Data!O:O,Data!A:A,$D$5,Data!C:C,$D$8,Data!B:B,$D$11,Data!H:H,$D$17,Data!E:E,$B32)
The only thing that didn't make sense to me is the AMS product drop down, but I am sure you can adjust the formula to add that. The only issue you may have is if ALL is an option versus a specific product. The AVERAGEIFS formula will be slightly different (see two examples I gave you), so you may need an IF statement.
Related
Basically, I want to filter, and then add together, one column('Essay Sentences'!H6:H1400) using the information of another column, which I need to find using a cell(A2).
For example, I have the column 0011c ‘Essay Sentences’!H6:H1400 and I want to add together only the 0011c’s that also have at least one 0012a. But I only get the “0012a” column from searching for it with cell A2.
A2 could be anything from the header 'Essay Sentences'!F4:AZ4, so I need the formula to look for any column under these headers.
Also, I need to use the FILTER() and SUM() functions.
Here's what I got so far:
=SUM(FILTER('Essay Sentences’!H6:H1400, INDEX('Essay Sentences'!F4:AZ1400, 0, MATCH(A2, 'Essay Sentences'!F4:AZ4, 0)) > 0))
Link to Source Data1
Link to Source Data2
A mock up example as below:
Please see below solution using SUMPRODUCT based on your mock-up example.
The following formula is in Cell C10 in my solution. You cannot drag it across board as it has been hard-coded to specific named ranges. Use INDIRECT for more flexibility if needed.
=SUMPRODUCT(FRUITS*(SNACKS>0)) or =SUMPRODUCT(INDIRECT($A10)*(INDIRECT(B$9)>0))
The three formulas are essentially the same depends on if you prefer to use Named Ranges (eg. FRUIT stands for cell B2:B5) or actual ranges (eg. B2:B5) in the formula.
Using INDIRECT enables you to drag the formula across board but the trade off is that it will slow down the calculation. If you are only comparing one column with another, just use the Name or the actual range in the formula.
I have a table, that consists of 2 columns. I need to highlight values in first column, that are more or equal than 10% of the number in the second column.
I created additional row there, to clarify, but I can't use it in the formula, tho.
I need to use relative formula, since I am applying filter to these rows, so I need this all not to fall apart, if I am sorting table via filters.
I have looked through this topic: Excel Conditional Formatting based on Other Column , but I couldn't apply it. Or I failed at applying it.
I have tried to apply to the range (of =$A$2:$A$8)following formulas (in conditional formatting "Use a formula to determinate..."):
=$A2*100/$B2>=10
=ADRESS(ROW(),COLUMN())*100/ADRESS(ROW(),COLUMN()+1)>=10
But none of them did the trick. Can someone help me with this one, please? Thanks.
You misunderstand how conditional formatting works.
"I need to use relative formula ..."
No. You don't.
Conditional formatting, although I have never seen it stated anywhere, uses array-based formula. As such you describe the usage of the first instance in the (unfiltered) table, tell it the area of the table, and it will calculate the necessary relative addressing by itself. You do not tell it the relative addressing. Why it behaves like that, I can't tell you.
The formula will then maintain itself throughout any filtering or sorting you carry out. You do not need to account for filtering and sorting - provided, of course, you set everything up on the unfiltered table to begin with.
You can see from the attached screenshots, simply using your formula of =$A2*100/$B2>=10 and applying it to $A$2:$A$8 worked perfectly.
Instead of writing the formula multiple times at multiple instances, I'd like excel to detect the formula based on a defined reference.
Column F should be calculated based on the Operation defined in column E. In this example, I can use IF() as I only have 4 Operations but this question is linked to another scenario where I have over 20 Operations.
I have all the formula's ready but I'd love to understand if there is way to use the appropriate formula based on "Operation" Column.
I would approach your situation by labeling your Column A, B, C, or X, Y, Z or something similar for consistent readability with your formulas.
Second thing I would do is build your formula table similar to what you have except that I would change your formula from being sheet and cell references to being you variable references:
A+B+C+D
A-B-C-D
A/B/C/D
A*B*C*D
Make sure the formulas are written with operators the same way you would if you were using a cell reference.
Then based on your lay out on sheet 3 I would use a VLOOKUP:
=VLOOKUP(E2,SHEET4!$A$2:$B$5,2,0)
Place that in F2 and copy down. That will tell you if you are pulling the right formula or not.
In G2 use the following:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(F2,"A",A2),"B",B2),"C",C2),"D",D2)
Check this to see that your substitution of your values for your variables is correct.
Then select cell H2 to make it the active cell. Then go Formula Ribbon and select Define Name from the Definied Names section.
Give a name for your formula such as ANSWER.
For your formula use
=evaluate(G2)
once you have added the defined formula to the list of formulas go to cell H2 and enter the following:
=ANSWER
now if you want to avoid all those helper columns, you can substitute one formula into the other.
I am using the Excel SUMIFS formulas to look for certain item numbers and add that value to the sum. The issue I am having is that many of our item numbers are very close to each other, i.e. 52000135890001 & 52000135890002.
The issue I am having is that the SUMIFS function seems to see these two items as the same value, and is suming them together. I want them added separately, as to us, they are essentially two different items.
I have tried changing the data type for the item numbers to every possible option but the formulas continues to group these together when performing the function.
Does anyone have any ideas how I can still use the SUMIFS formula but somehow tell it to see these two items as different, instead of adding them together under the same criteria?
I am at a loss and losing my mind so any advice would be beyond helpful!
Kyle
You format all your required cells (range cells, criteria and sum_range cells) to custom format as ##################', then apply the sumif it will work by using the right value.
Hello guys, I have been trying to implement the DSUM function but failed to figure it out. I looked through the previous DSUM posts on here and still don't understand. This is my problem:
on I8:L9, i have to implement the DSUM to calculate the "calculated quantity sold" for each item, ie Textbook, Novel,notepad and laptop. from A9-A16
I am supposed to use these values on B20 - B23. I don't know how to make sure i have multiple criteria for the DSUM function.
I tried this and it worked only for the first function: =DSUM(bookstore,J8,I8:I9)
This gave me the correct value only for Textbook, It summed up the quantities for textbook. What I want to do now is replicate it down so that it is the same for all the other elements.
Please help. thank you
With the setup you have then using this formula in B20 copied down will give the cumulative total of the categories
=DSUM(Bookstore,J$8,I$8:I9)
so that will give the sum for Textbook only in B20 but then in B21 it will be the sum for Textbook and Novel combined....then in B22 Textbook, Novel and Notepad (A22 should be "Notepad" to match I11)
To get the sum for the item in question only you could subtract the previous values above, i.e. use this version in B20 copied down
=DSUM(Bookstore,J$8,I$8:I9)-SUM(B$19:B19)
....but all things being equal I agree with user667489, except SUMIF is usually preferable for a single condition, i.e. in B20 copied down
=SUMIF(A$9:A$16,A20,D$9:D$16)
Is there any particular reason that you need to use DSUM to do this? You're making life very hard for yourself. You could do this much more easily via SUMPRODUCT or by using a pivot table.
When you create a column of conditions on the same variable, and you specify that as your constraint range for DSUM, excel sums over your database range where any of those conditions are true. You can't make it apply the constraint from just one row, unless that's the only row other than the column headings. So you need to put your different constraints for the same variable in different columns. This gets very messy.
Here is a sumproduct formula that will accomplish what you're trying to do, which can be copied down:
=SUMPRODUCT(($D$9:$D$16)*($A$9:$A$16=I9))
Paste that into cells J9:J12 (or B20:B23).
Another alternative having entered the DSUM formula in B20 is to select the range B20:B23 and choose Data > What If Analysis > Data Table... Column Input Cell: I9, OK. This should give the formulas below:
B20: =DSUM(bookstore,J8,I8:I9)
B21:B23: {=TABLE(,I9)}
Note: the Table formula cannot be entered from the formula bar, it is automatically generated by the Data Table command. (The same procedure could also be used to enter formulas in J9 and J10:13.)
I'd also recommend using SUMIF, or looking at PivotTables which could be used easily for this and create the list of categories for you.