How build formula IF in Excel? - excel

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))

Related

perform function on criteria in SUMIF function

I am writing a SUMIF function on a range with a format such as:
A B
1 1.1 5
2 1.2 5
3 1.3 5
4 2.1 5
5 2.2 5
I want the SUMIF to group values together by their integer, i.e.:
A B
1 1 15
2 2 10
I can do this by creating a third column C and applying INT(A) so that:
A B C
1 1.1 5 1
2 1.2 5 1
3 1.3 5 1
4 2.1 5 2
5 2.2 5 2
and (for 1)
=SUMIF(C:C, 1, B:B)
Is there a way to do this in one cell? i.e.
=SUMIF(A1:A5, "int(range) = 1", B1:B5)
I have also tried:
=SUMIF(A1:A5, "1*", B1:B5)
and
=SUMIF(A1:A5, 1&"*", B1:B5)
But these also do not work
You can use SUMPRODUCT e.g.
=SUMPRODUCT(--(INT($A$1:$A$5)=C1),$B$1:$B$5)
INT($A$1:$A$5)=C1 produces an array of TRUEs and FALSEs. The -- operator converts that to an array of 0s and 1s. Then you multiply by the values in B.
Formula in cell F12 is:
=SUMIFS($B$1:$B$5;$A$1:$A$5;">="&E12;$A$1:$A$5;"<"&E12+1)
Drag down
With Excel 365 you can do it like-
=LET(x,UNIQUE(INT(A1:A5)),y,SUMIFS(B1:B5,A1:A5,">="&x,A1:A5,"<"&x+1),CHOOSE({1,2},x,y))

How to use Fill Handle to copy same value in the same steps of row in Excel

confuse wiht the Title
Well sorry my English doesn't look good
but I'll try to describe what I mean
Suppose I have this kind of values
0 A B C D F G H I J
1 20 =B1
2 10 =B3
3 30 =B5
4 8 =B7
5 9 =B9
6 4 etc.
7 79
8 67
9 63
10 45
as you seen above
I want to copy every value in cell B in two step down to cell D with Fill Handle
How can I do it ?
Any Formula I can use regarding this ?
Thanks before
In Cell D2 you can use the below formula, then drag down:
=INDEX(B:B,(ROWS($B$1:B1)*2)-1,1)
Please try:
=OFFSET(B1,ROW()-1,)

Excel using SUMIF to calculate totals of multiple columns

I'm trying to use Excle's SUMIF to calculate totals of Col1 to Col5 for dates that are similar.
My formula is as follows =SUMIF($A2:$A7,A10,$B2:$F7), but this only gives me the total of a single column.
How can I get the Totals of all the columns based on the date like I've shown in my results.
Date Col 1 Col 2 Col 3 Col 4 Col 5
1/5/2017 1 2 2
1/5/2017 5 3 1
1/5/2017 9 5 5
2/5/2017 10 5 3
2/5/2017 20 10 3
2/5/2017 6 8 1 5
Desired Results
1/5/2017 15 7 7 3 1
2/5/2017 30 11 11 11 8
use below formula in cell B11
=SUMIF($A$2:$A$7,$A11,B$2:B$7)
Per the example you provided, One solution is to use SUMPRODUCT
Multiplies corresponding components in the given arrays, and returns the sum of those products
Microsoft Docs give a thorough example, but per SO etiquette, here is an example in case of link-rot: [FYI, I used absolute reference for easier filling across, arbitrary how you get it done though]
Forumlas shown:
Formula is kind of hard to see without clicking on image:
=SUMPRODUCT(($B$3:$B$8=$B$11)*C3:C8)
This basically breaks down like this, it searches the B:B column for a match, and it will naturally return a true or false for the match, or 0/1 counterparts, and multiplys that by the number found in the column to the right (C3:C8), so it will either be 1 * # = # or 0 * # = 0

"The formula refers to a range" error in Excel

Am new to Excel, please help me with this:
A B
2 9 =IF(A2:A6>=7,"1","0")
3 4
4 7
5 4
6 5
For B2 the formula works perfectly fine but in B3 it selects from A3:A6.
I know the concept of Absolute referencing. But here in this example it should basically work without any errors, right?
A B c
2 9 1 =Sum(A2:B2)
3 4 2
4 7 33
5 4 3
6 5 22
The above example works fine. What is the difference between two?
If you want the A2:A6 range to float down as you copy the formula to other rows, use:
=IF(MAX(A2:A6)>=7, 1, 0)
However, if you want row 6 locked as the finite terminator of the range then lock it as absolute with a $ like this,
=IF(MAX(A2:A$6)>=7, 1, 0)
        

Excel - Lookup value in multiple columns

I have a datasheet with multiple columns that I want to search through - ending up with returning the top row value(s) in the found column(s). How to do this?
My idea would be to combine index with match, but I am rather lost for specific ideas...
January February March April May June
1 2 3 4 5 6
7 8 9 10 11 12
2 7 1 8 4 5
9 10 11 12 6 3
E.g. Search for: ID 3 - should return: March, June
Regards,
Nyborg
You need to add a VLOOKUP for each columns and after build the result
Following the Scheme:
A7 -> =IF(IFERROR(VLOOKUP($A$9;A1:A5;1;);"")="";"";A1) and autocomplete
D9 -> =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(CONCATENATE(A7;",";B7;",";C7;",";D7;",";E7;",";F7);",,";",");",,";",");",,";",")
D10 -> =IF(RIGHT(D9;1)=",";LEFT(D9;LEN(D9)-1);D9)
Formula for D9 & D10 it's only to have a good display of the results.
UPDATE Version:
Considering you agree to have the Row 7 ... You can simplyfy using the Result formula:
=INDEX(List;SMALL(IF(List<>"";COLUMN(List)-MIN(COLUMN(List))+1);1))&IFERROR(", " & INDEX(List;SMALL(IF(List<>"";COLUMN(List)-MIN(COLUMN(List))+1);2));"")&IFERROR(", " & INDEX(List;SMALL(IF(List<>"";COLUMN(List)-MIN(COLUMN(List))+1);3));"")
List it's the name Range of Row 7. The formula shall be apply with Ctrl+Shift+Enter.
This formula collect the first 3 value.
If you want more, add for each nth value you have:
&IFERROR(", " & INDEX(List;SMALL(IF(List<>"";COLUMN(List)-MIN(COLUMN(List))+1);3));"")
changing the last numer (in this case 3) and putting 4, 5, 6 ...
Obviusly if the result can be a lot, have few sense... Consider to use VBA !

Resources