Sum product from the cell that contain IF AND - excel-formula

How to sum value from the column that have IF AND function?
How to find sum
I try to sum the value but it return 0.

I found the answer.
Instead of using =SUM() use =SUM(VALUE()) instread, and press CTRL+SHIFT+ENTER (instead of only ENTER).

Related

Count number of rows with values excluding #N/A or Null formula values from the count [duplicate]

Currently using the following forumlas to count the number of records in all of column Z that does not have #N/A but it does not work. All the rows in Column Z have a formula itself (Which is why some of them display #N/A, its a VLOOKUP).
=COUNTA(Z:Z)-SUM(IF(ISNA(Z:Z),1))
=SUMPRODUCT(--(TRIM(Z:Z)<>"#N/A"))
These return a "0" value which is not true, what am I doing incorrect?
If you are using Excel 2010 or later, to count non-error values you can use (regular formula)
=AGGREGATE(3,6,Z:Z)
No reason to use an array formula for this, you can just do something like
=COUNTIFS(Z:Z, "<>#N/A",Z:Z, "<>")
or
=COUNTA(Z:Z) - COUNTIF(Z:Z,"=#N/A")
The first one counts every nonblank, non #N/A cell. The second does what you're trying to do now and subtracts the total of #N/A cells from the total of every nonblank cell. Maybe using ISNA is technically more correct or faster, but this probably works just as well for most cases.
This array formula sums the cells of range Z:Z that are not NA's :
=SUM(IF(NOT(ISNA(Z:Z)),Z:Z)) Ctrl+Shift+Enter
This one (which is probably what you want) sums all but errors:
=SUM(IF(NOT(ISERROR(Z:Z)),Z:Z)) Ctrl+Shift+Enter
And another (simpler) one
=SUM(IFERROR(H:H, 0)) Ctrl+Shift+Enter
Are you entering it as an array formula? Press Ctrl-Shift-Enter instead of just enter. I think the first formula should work.
=COUNTA(Z:Z)-SUM(IF(ISNA(Z:Z),1))

How to make VLOOKUP() match with the next greater value?

Please consider the table below:
If we write VLOOKUP(12,A1:B6,2,TRUE) we will get 2 as a result since the lookup value will match with 10 in the first column of the array and return the corresponding value in the second column.
What I am looking for is somewhat different. I want to find the value corresponding to the next greater value. For example, when my lookup value of 12, it will now match with 15
in the first column and then return 3 from the second column.
How do I do this preferably with VLOOKUP function?
If you have Excel O365 with the FILTER function, and if your lookup value is in D1, you can use:
=MIN(FILTER(B1:B5,A1:A5>=D1))
If the entries in column B are text, and not sorted numeric, you can use:
=INDEX(FILTER(B1:B5,A1:A5>=D1),1)
If you do not have O365 available then you can use the INDEX/MATCH functions entered as array formula:
=INDEX($B$1:$B$6,MATCH(TRUE,$A$1:$A$6>12,0))
Array formula after editing is confirmed by pressing ctrl + shift + enter

Is there a way to find out the values ​of 4 cells are the same or different in MS Excel

I found something confusing in Microsoft Excel.
I fill Cell A1, A2, A3, A4 with the same number 1,
then I enter the formula = A1 = A2 = A3 = A4 on cell A5,
why do I get FALSE results?
Is there a way to find out the values ​​of 4 cells are the same or different?
If all you are using is these numbers you could check for the standard deviation. If it's 0 then all values are equal:
=STDEV.P(A1:A4)
So a check for equality could look like:
=IF(STDEV.P(A1:A4),"Different","Equal)
You can compare the range with the first cell, include it in the AND function and enter it as an array formula.
It will process both text and numeric values.
=AND(A1:A4=A1)
Array formula after editing is confirmed by pressing ctrl + shift + enter
You can use COUNTIF.
This is how it works in this example:
The COUNTIF returns a count of any cells that do not contain "1" which is compared to zero. If the count is zero, the formula returns TRUE. If the count is anything but zero, the formula returns FALSE.
You can apply that to any value you want to compare. Just place it before the "<>" in the formula.
This also works for "strings".

How to check if a value is between any 2 values in a range?

I need to check if a value from column E is between any pair of values in A:B and if so, return a letter from column C. Desired result is in F column.
I think an Array formula using Match() to get the row on which the hit is found that is then passed to INDEX() may solve this:
=INDEX(C:C,MATCH(1,(E3>=A:A)*(E3<=B:B),0))
That's an Array formula (CSE Formula) so you'll have to Ctrl+Shift+Enter it so it gets the squirrelly brackets.
If you have a value that falls into more than one range, this will return the first row too, which is a nice feature.

How to find max value with INDEX-MATCH and MAX

I am newbie to excel. I have this following data in excel sheet.
I want to have the value of G11 returned 27, as the value of its corresponding cell in column D, which is D11 matches to E8, and E9, which then correspond to the values of 14 and 27 in column J. Could someone tell me how to return a match value when I have two match situations and I need the maximum one. I am using the following formula.
=IF(D11=1,0,INDEX($H$4:$H$13,MATCH(D11,$E$4:$E$13,0),1))
I know if I use
=IF(D11=1,0,INDEX($H$4:$H$13,MATCH(D11,$E$4:$E$13,0)+1,1))
it returns me with the value 27 or greater of the both values but it will not work if I have three values and I want the maximum.
This will do it confirmed with ctrl+shift+enter:
{=MAX(IF(E4:E13=D11,J4:J13))}
Curly braces should not be entered manually, be sure to confirm with ctrl+shift+enter
This says:
Look for rows where the value in E matches D11
If you find one, return the value in column J
Give the maximum value of the result you find
This will cause errors if there are no matches. You also probably are designing your sheet in a not ideal way.
You can use the formula:
=IF(D11=1,0,MAX(IF(D11=$E$4:$E$13,$H$4:$H$13,0)))
entered as an array formula (i.e. you press Ctrl+Shift+Enter instead of Enter alone) for G11.
MATCH returns the first match, so that's why I'm using another IF instead.

Resources