I have 4 numbers I need to add up from a database example (12, 0, 0, 3) I need to know the average of these numbers ignoring the 0s as in 12 + 3 /2 = 15 Ave 7.5. I cannot find a way of avoiding the 0s which makes the answer 12 + 3 /4 = 3.75.
Thanks For Any Help
Try
=AVERAGEIF(A1:A3,">0",A1:A3)
works with your numbers... 12 in A1, 0 in A2, 3 in A3.
Related
Bit of a silly question, but i've got a small logic problem with an excel formula
If ive got 2 rows of various values, such that it looks like:
A B
1 101
2 150
3 200
4 50
5 70
6 20
How do I find the sum of all values under 'B' that are adjacent to a value in 'A' that is greater than 3?
So essentially it would add up only 50, 70 and 20, as those are adjacent to 4, 5 and 6.
Currently I've got:
=SUMIF(H5:H11,INDEX(B1:B6,MATCH("<3",A1:A6,-1),B1:6))
Naturally this is going to be used with a much larger data set, of a few thousand values - so any advice would be incredibly appreciated.
Thank you!!
Try this formula:
=SUMIF(A1:A6,">3",B1:B6)
Returns 140
I'm working with a very large geo-dataset that looks like this:
- NYC Boston LA Dallas Rome
NYC - 4 2 9 21
Boston 4 - 11 8 6
LA 2 11 - 1 18
Dallas 9 8 1 - 7
Rome 21 6 18 7 -
I'm trying to fetch all relevant values across several criteria horizontally, for example:
Criteria: >0 >0 >3 >3 >3
Criteria: <3 <3 <10 <10 <10
NYC LA - Boston Dallas -
Boston - - NYC Dallas Rome
etc...
I've been trying different formulas using (index, small, rows), but just can't seem to make it work. Any help would be much appreciated!
You can make this work with a formula but you will have to make some very specific formatting changes to your layout. Per the supplied image,
B2, C3, D4, E5, F6 are zeroes, not hyphens.
B2:F6 have a custom number format of _(* #,##0_);_(* (#,##0);[Color9]_(* "-"_);_(#_).
I1:M1 have values of 0, 0, 3, 3, 3 and a custom number format of >0.
I2:M2 have values of 3, 3, 10, 10, 10 and a custom number format of <0.
I3:M7 have a custom number format of _(* #,##0_);_(* (#,##0);[Color9]_(* "-"_);_(#_).
Put this formula in I3 then drag right and down.
=IFERROR(INDEX($A$1:$F$1, AGGREGATE(15, 7, COLUMN($A:$F)/((INDEX($A:$F, MATCH($H3, $A:$A, 0), 0)>I$1)*(INDEX($A:$F, MATCH($H3, $A:$A, 0), 0)<I$2)*(INDEX($A:$F, MATCH($H3, $A:$A, 0), 0)<>0)), COUNTIFS($I$1:I$1, I$1, $I$2:I$2, I$2))), 0)
I have the following little table. I'd like a formula that finds the number of values where the cumulative total (of column B) is less than some threshold (tx).
I tried
{=MIN((SUM(OFFSET(B1,0,0,A1:A17))>tx)*A1:A17)-1}
but OFFSET doesn't seem to be arrayable like that. Obviously, this would be trivial with a helper column, but for certain reasons that is not possible.
So the correct answer here should be 10.
tx = .8
A B
1 0.112106465
2 0.110981698
3 0.091959216
4 0.082163441
5 0.073292066
6 0.072407529
7 0.071646289
8 0.061646797
9 0.06011448
10 0.057566381
11 0.050341978
12 0.048227061
13 0.043207335
14 0.03940462
15 0.012914194
16 0.007603446
17 0.004417003
You're not really looking for a MIN; rather it should be MAX that follows your condition.
In E7 as a standard (non-array) formula,
=AGGREGATE(14, 6, ROW(1:17)/(SUBTOTAL(9, OFFSET(B1, 0, 0, ROW(1:17), 1))<D7), 1)
I prefer the following array formula** due to its non-volatility:
=MATCH(TRUE,MMULT(0+(ROW(B1:B17)>=TRANSPOSE(ROW(B1:B17))),B1:B17)>=0.8,0)-1
Regards
The most succinct way to do it I've found is
=SUM(--(SUBTOTAL(9,OFFSET(B1,,,A1:A17))<0.8))
entered as an array formula, or, equivalently,
=SUMPRODUCT(--(SUBTOTAL(9,OFFSET(B1,,,A1:A17))<0.8))
I have data in excel:
N: 1 2 3 4 5 6 7 8 9 10
H: 9.5 9.4 6.5 V 9.5 KR 9.0 8.5 5 7
If H >=7 then NC= 1 esle NC=0.5
If H=V or H=KR then NC=0
I want caculator total of NC from 1 to 10
How build formula in Excel?
Can you help me?
I took a stab at what I think you're looking for. Given a data setup like this:
In cell D2 is this formula:
=COUNTIF(B2:B11,">=7")+COUNTIF(B2:B11,"<7")*0.5
Not tested, but you can just nest IFs, putting another IF inside the true or false clause.
Arbitrarily assuming your value of H is in cell A2:
=IF(OR(A2 = "V", A2 = "KR"), 0, IF(A2 >= 7, 1, 0.5))
B5*C5+B6*C6... till 30, but in a formula...
Example:
B - C
3 - 40
4 - 50
1 - 60
0 - 20
3 - 80
Does a formula like this meet your requirement?
=SUMPRODUCT(B5:B30,C5:C30)
Make D5 be =B5*C5, and the same for D6, D7, etc... then your formula would simply be =SUM(D5:D10)