I have a problem in my formula regarding on "EQUAL/MATCH" value using if and index match. I have two sheets, "Targets(database)", and "STUDENTS(input)". Example from sheet "STUDENTS" if I input 80% in Performance1, it will look to sheet Target(table) the Performance1 having equal to 80% and multiply it to the multiplier 10%. See table and sample below
TARGET(table range)
STUDENTS(correct answer)
FORMULA
=IF(
C7<Targets!$C7,
Targets!$C$5*$B7,
IFERROR(
INDEX(
Targets!$C$5:$H$5,1,
MATCH(STUDENTS!C7,Targets!$C7:$H7,0)
)*$B7,
INDEX(
Targets!$C$5:$H$5,1,
MATCH(STUDENTS!C7,Targets!$C7:$H7,1)
)*$B7
) )
Now the problem here is that when I input an "EQUAL/MATCH" value, example Performance1 80% the answer must be 3%(10%*30%) but it gives me 2.70%(9%*30%). See below incorrect answer
STUDENTS(incorrect answer)
What can I try next?
Related
I have a spreadsheet that is using the SUMIF function. It works very well to summarize single values from another column but I want to be able to potentially multiply a single entries value before summing it.
I'm unable to attach photos so I'll try to describe. My spreadsheet has this equation on it:
=SUMIF(L25:L31,"x",$K$25:$K$31)
Then if I put an 'x' on a row in column 'L' it will include the value from column 'K' in the summation. I want to be able to use 'x2', 'x3', 'x4', etc. and multiply the value before the summation. Is that possible with Excel?
Multiplication is distributive; the product of the sum is the same as the sum of the products. So you can move the multiplier to the outside of the equation if I am understanding your question correctly. Where "y" is the multiplier and "x" is the criteria you are looking up, the below should work:
=y*SUMIF(L25:L31,"x",$K$25:$K$31)
If the multiple is a variable, then I would suggest adding helper columns, and simply change the sum range on the SUMIF formula.
Note that the SUMPRODUCT suggested does not take into account the conditional nature of the sum that I assume you are looking for (otherwise why would you use SUMIF instead of SUM?)
This should do the trick:
=SUMPRODUCT(IFERROR($K$25:$K$31*IF($L$25:$L$31="x",1,MID($L$25:$L$31,2,255)),0))
But must the "x" be there? If you have the flexibility to switch to 1, 2, 3 instead of x, x2 and x3, that would open up to simplify the formula to this
=SUMPRODUCT($K$25:$K$31*$L$25:$L$31)
The latter should be more efficient as well, in case your actual data is large.
If I've not misunderstood, this would produce the result of applying a variable multiplier to the qualified data points and then sum it up:
=SUM( (L25:L30="x") * K25:K30 * {1;2;3;4;5;6} )
The 1;2;3... column array is arbitrary - I just invented it for example. If it really is an incremental sequence, then you can produce the same this way and gain the advantage that it is easier to extend (without typing lots of numbers):
=SUM( (L25:L30="x") * K25:K30 * SEQUENCE( ROWS(L25:L30) ) )
If this is the solution and you really want to streamline it, then make it a little cleaner with LET:
=LET( sumRange, K25:K30,
criteriaRange, L25:L30,
criteria, "x",
size, MIN( ROWS( criteriaRange), ROWS( sumRange ) ),
SUM( (criteriaRange = criteria ) * sumRange * SEQUENCE( size ) ) )
If the multipliers are not an incremental sequence, then a third variable could be introduced to replace SEQUENCE( size ) that would contain the multiplier array.
I have 3 conditions based on this table: https://i.stack.imgur.com/GAeT0.png
Conditions are:
In column "Stadiu" (starting from D5) should type:
RIDICATA if the number from Populatie is > 1000 and the column Eveniment has Mondiala in it
MEDIE if the number from Populatie is > 500 or <= 1000 and the column Eveniment has Mondiala
MEDIE if the number from Populatie is > 500 and the column Eveniment has Internationala
SLABA = rest
I tried this formula:
=IF(AND(C5>1000;FIND("Mondiala";A5));"ridicata";IF(AND(C5>500;C5<=1000;FIND("Mondiala";A5));"medie";IF(AND(C5>500;FIND("Internationala";A5));"medie";IF(AND(C5<500);"slaba"))))
but it doesn't work.
I am new to Excel, so I hope you guys can help me what I am doing wrong. Thanks!
When evaluating the formula, anywhere that the FIND function doesn't find the string you're searching for, it returns a #VALUE error instead of 0 or FALSE. That's causing the whole formula to fail in those circumstances, so you need to handle those cases with IFERROR.
In addition, your nesting wasn't quite correct. You did not have an ELSE result for cases where all three tests failed. The following formula should return the expected results based on your criteria provided:
=IF(AND(C5>1000;IFERROR(FIND("Mondiala";A5);0));"Ridicata";IF(OR(AND(C5>500;C5<=1000;IFERROR(FIND("Mondiala";A5);0));AND(C5>500;IFERROR(FIND("Internationala";A5);0)));"Medie";"Slaba"))
Might be a little easier to relate it to your test criteria by spreading it out into sections:
=IF(
AND(
C5>1000;
IFERROR(FIND("Mondiala";A5);0)
);
"Ridicata";
IF(
OR(
AND(
C5>500;
C5<=1000;
IFERROR(FIND("Mondiala";A5);0)
);
AND(
C5>500;
IFERROR(FIND("Internationala";A5);0)
)
);
"Medie";
"Slaba"
)
)
I have this formula:
=IFERROR(
(
(
IFERROR(INDIRECT($A6&"!$E$15");"")
+IFERROR(INDIRECT($A6&"!$E$29");"")
+IFERROR(INDIRECT($A6&"!$E$43");"")
+IFERROR(INDIRECT($A6&"!$E$57");"")
+IFERROR(INDIRECT($A6&"!$E$71");"")
+IFERROR(INDIRECT($A6&"!$E$84");"")
)
/6);"")
When any of these IDIRECTS return a blank value, I get an #VALUE! error (without the first IFERROR). Each individual line works just fine, and when putting them in cells individually, I can average them fine. If I remove the /6 part of this formula however, and wrap the lines with an AVERAGE-formula, I get the #VALUE! error also.
How can I proceed?
EDIT, SOLUTION FOUND (Thanks Mrig):
=IFERROR(
(
(
IF(ISNUMBER(INDIRECT($A7&"!$E$15"));INDIRECT($A7&"!$E$15");0)
+IF(ISNUMBER(INDIRECT($A7&"!$E$29"));INDIRECT($A7&"!$E$29");0)
+IF(ISNUMBER(INDIRECT($A7&"!$E$43"));INDIRECT($A7&"!$E$43");0)
+IF(ISNUMBER(INDIRECT($A7&"!$E$57"));INDIRECT($A7&"!$E$57");0)
+IF(ISNUMBER(INDIRECT($A7&"!$E$71"));INDIRECT($A7&"!$E$71");0)
+IF(ISNUMBER(INDIRECT($A7&"!$E$84"));INDIRECT($A7&"!$E$84");0)
)/
(
COUNTIF(INDIRECT($A7&"!$E$15");">=0")
+COUNTIF(INDIRECT($A7&"!$E$29");">=0")
+COUNTIF(INDIRECT($A7&"!$E$43");">=0")
+COUNTIF(INDIRECT($A7&"!$E$57");">=0")
+COUNTIF(INDIRECT($A7&"!$E$71");">=0")
+COUNTIF(INDIRECT($A7&"!$E$82");">=0")
)
);"")
The COUNTIF's bascially replaces the number "6" in the original code, and checks which of the INSNUMER's (instead of IFERROR's) that isn't blanks, so anything that's 0% or higher (actual value) will be counted, to get to the true average.
Using the suggestions above in the comments, you can use IF(ISNUMBER()) instead of IFERROR()
=IFERROR(
(
(
IF(ISNUMBER(INDIRECT($A6&"!$E$15"));INDIRECT($A6&"!$E$15");0)
+IF(ISNUMBER(INDIRECT($A6&"!$E$29"));INDIRECT($A6&"!$E$29");0)
+IF(ISNUMBER(INDIRECT($A6&"!$E$43"));INDIRECT($A6&"!$E$43");0)
+IF(ISNUMBER(INDIRECT($A6&"!$E$57"));INDIRECT($A6&"!$E$57");0)
+IF(ISNUMBER(INDIRECT($A6&"!$E$71"));INDIRECT($A6&"!$E$71");0)
+IF(ISNUMBER(INDIRECT($A6&"!$E$84"));INDIRECT($A6&"!$E$84");0)
)/6);"")
I started off thinking that your 'stagger' was 14 rows so I went with this array formula:
=AVERAGE(IF(MOD(ROW(E15:E84), 14)=1, IF(ISNUMBER(INDIRECT($A6&"!E15:E84")), INDIRECT($A6&"!E15:E84"))))
... but your 'stagger' is not a consistent 14 rows; the last gap is 13 rows so I modified it to this:
=AVERAGE(IF(ROW(15:84)={15,29,43,57,71,84}, IF(ISNUMBER(INDIRECT($A6&"!E15:E84")), INDIRECT($A6&"!E15:E84"))))
That produces a true average without zero substitution on blank cells while discarding text values.
Related post:"How do you extract a subarray from an array in a worksheet function?" I cannot comment or reply to that post.
I have a data array of five columns (5000 records), and an NCriteria array of six columns (400 records).
The following abridged formula is used to return the matching row number from the array, NCriteria, for every data record:
= MATCH(TRUE, INDEX(
COUNTIFS(
J2, INDEX(NCriteria,,2),
K2, INDEX(NCriteria,,3),
K2, INDEX(NCriteria,,4),
M2, INDEX(NCriteria,,6)
)
<>0,)
,0)
Sample data:
Account[J], Date[K], Description[M]
xxx9608, 30/06/2015, Wdl ATM CBA ATM
Sample NCriteria:
Account[col2], date[col3], date[col4], description[col6]
<>"", >=11/12/2013, <=12/1/2014, *BUNNINGS*;
xxx9608, >=14/06/2013, <=30/06/2015, Wdl*;
This construct is flexible, but slow in Excel. I can extract a sub list of matching rows from NCriteria for Description [M] alone as:
{375, 150, 149}.
Question is, how can I use this sub-array of row numbers as indexes for additional searches of matches for [J], [K], etc.
Thanks in advance if anyone can help.
I have 3 columns with the following name:
name1, name2 and value.
I want to obtain in another sheet two tables having two compulsory condition (min and max calculated using name1 and name2):
the name of the first table to be taken from the column with name2 and this table has two partition.
the first partition named max, is calculating the max for 30_-20, 40_-20, 50_-20, 30_22, 40_22, 50_22, 30_60, 40_60, 50_60 and second partition named min, is calculating the min for 30_-20, 40_-20, 50_-20, 30_22, 40_22, 50_22, 30_60, 40_60, 50_60.
What I want to say can be viewed in the following picture.
I need this for my job, and I don't know anything about macros. I think it will be necessary to learn macros.
Given a layout on a single worksheet similar to your sample image.
The standard formula(s) for G3, I3, M3 and O3 are:
=MAX(INDEX($C$2:$C$999*($A$2:$A$999=H3)*($B$2:$B$999=H$1), , ))
=MIN(INDEX($C$2:$C$999+(($A$2:$A$999<>H3)+($B$2:$B$999<>H$1))*1E+99, , ))
=MAX(INDEX($C$2:$C$999*($A$2:$A$999=N3)*($B$2:$B$999=N$1), , ))
=MIN(INDEX($C$2:$C$999+(($A$2:$A$999<>N3)+($B$2:$B$999<>N$1))*1E+99, , ))
Fill down as necessary. It is usually easier to reference a cell containing a value (e.g. 30_-20) than repeatedly hardcoding the value into a variety of similar formulas. I've used H3:H5 and N3:N5 for the column A values.
How it Works:
See MINIF, MAXIF and MODEIF with Standard Formulas.