Sumif partial data in a column meets a criteria - excel

I am trying to get a sum of G3:G47 if A54 matches the first 3 characters in the cell range A3:A47
This is the formula I have been trying to tinker with, but it doesn't work.
=SUMIF(A$3:A$47,LEFT(A$3:A$47,3)=[#[Sprint ID]],C$3:C$47)

Use WildCards:
=SUMIF(A$3:A$47,[#[Sprint ID]] & "*",C$3:C$47)

Related

Sumifs criteria to look for the value in two columns

hi i am using sumifs function "=SUMIFS('AT&TT'!$F:$F,'AT&TT'!$C:$C,AT!$C$3,'AT&TT'!$E:$E,AT!$E$3,'AT&TT'!$H:$H,AT!G2)"
which is working fine, but additionally what I require is in first criteria of the formula
"=SUMIFS('AT&TT'!$F:$F,'AT&TT'!$C:$C,AT!$C$3,'AT&TT'!$E:$E,AT!$E$3,'AT&TT'!$H:$H,AT!G2)"
instead of column range AT&TT'!$C:$C I need AT&TT'!$C:$D, i want to look for the value in either of the columns.
I tried using vlookup as criteria inside sumifs.
So what about the simple method:
=SUMIFS('AT&TT'!$F:$F,'AT&TT'!$C:$C,AT!$C$3,'AT&TT'!$E:$E,AT!$E$3,'AT&TT'!$H:$H,AT!G2)+"=SUMIFS('AT&TT'!$F:$F,'AT&TT'!$D:$D,AT!$C$3,'AT&TT'!$E:$E,AT!$E$3,'AT&TT'!$H:$H,AT!G2)"
Where you do 1 sumifs for Range C and another for Range D .

excel vba select range between two numbers

C column is sorted from the input data
From the sorted output, the selected range should be with in -0.25 to +0.25
How to add more than one criteria in COUNTIF function or its similar function?
Original syntax:
.Resize(Application.CountIf(.Cells, "<0")).Select
Requirement:
.Resize(Application.CountIf(.Cells, ">-0.25 & <0.25")).Select
Replace CountIf with CountIfs when you want more than one condition. Try this:
.Resize(Application.WorksheetFunction.CountIfs(.Cells, ">-0.25", .Cells, "<0.25")).Select

Calculate the COUNTIFS criteria range dynamically

I have a excel formula as below,
COUNTIFS($A$8:$A$14,$A8,$B$8:$B$14,$B8)
Here I want the criteria range to be calculated with a simple logic.
Instead of $A$14 I want this value to be calculated A$8+4 i.e. $A$14
In other words, it should get the current row and add 4 to be the criteria range for COUNTIFS
How can this be done is excel within the COUNTIFS formula?
Cheers
You could use =OFFSET(Cell Reference, Rows, Columns) within your formula to achieve this, for example:
=COUNTIFS($A$8:OFFSET($A$8,6,0),$A8, etc...)
Lets assume that the size of your range to be returned is stored in the cell D1.
=COUNTIFS($A$8:INDEX(A:A,ROW($A$8)+D1),$A8,$B$8:INDEX(B:B,ROW($B$8)+D1),$B8)
If you want the range to be defined as a certain number of rows after the current row as stated in your question, then still assuming the number of rows to be added is in D1, you would use the following:
=COUNTIFS($A$8:INDEX(A:A,ROW()+D1),$A8,$B$8:INDEX(B:B,ROW()+D1),$B8)
Expanding on Oliver's answer. The full format of OFFSET allows you to specify a whole range, not just one cell. OFFSET(Reference, Row Offset, Col Offset, Height, Width) so you could do:
OFFSET(A8,0,0,4,1)
This specifies the range A8:A11. In the COUNTIF
=COUNTIF(OFFSET(A8,0,0,4,1),A8,...)
Locking cells with $ works the same way within OFFSET if needed.
Try this:
=COUNTIFS(INDIRECT("$A$8:$A$" & 8+6),$A8,INDIRECT("$B$8:$B$" & 8+6),$B8)

Returning multiple column headers values using multiple matching criteria

I am looking for returning multiple column values using multiple matching criteria.
Attached is a screenshot of sample sheet, which have my criteria on cell's B1 & C1.
So basically, when matching 2 criteria (example "Team1" & "low"), it should return columns header (example Name10 & name14) from the header ranger C3:N3.
I have tried a couple of formulas, and is is how far I gone: =INDEX($C$2:$AL$2,SMALL(IF(($A$3:$A$21=$B$1)*($B$3:$B$21=$C$1),ROW($A$3:$A$21)-ROW($A$3)+1),ROW(1:1)))
I am not sure what is missing?
enter image description here
enter image description here
Thanks in advance
Fox
First of all, in your example you point out row 3 and 4 but only one of the specified criteria are matched in this rows: low, because Team4 specifyed in the criteria it's not matched, so i will consider you are looking to match one OR both the criteria specified.
The only way i can imagine for do this with a formula is to use a formula like this
=SE(C3<>0;$C$2&", ";"")&SE(D3<>0;$D$2&", ";"")&SE(E3<>0;$E$2&", ";"")&SE(F3<>0;$F$2&", ";"")&SE(G3<>0;$G$2&", ";"")&SE(H3<>0;$H$2&", ";"")&SE(I3<>0;$I$2&", ";"")&SE(J3<>0;$J$2&", ";"") 'and so on...
where SE() it's function IF() in my language, with this formula in a column on the right of the table (for example col O) you will have a list of the names of that row where the corresponding number is different from 0...expand the formula down for all the rows and then, with a formula like this
=SE(O(A1=A3;B1=B3);O3;"")&SE(O(A1=A4;B1=B4);O4;"")&SE(O(A1=A5;B1=B5);O5;"")&SE(O(A1=A6;B1=B6);O6;"")&SE(O(A1=A7;B1=B7);O7;"") 'and so on...
with the function O() corresponding to OR() you will concatenate the strings (names) of the rows that match one OR both the criteria. If you whant to match both the criteria you should use AND() instead of OR().
The problem of this approach is that the formula becomes very long if you have a lot of names and a lot of rows, and if you add rows you have to modify the formula. Another problem is that if you match the same name more times it will be repeated in the list that the formula outputs...and the list of the names ends with a comma.
In fact, i can't tell that this is a good way for obtain what you need, but it's the only i can imagine only with formulas.
If you should use a macro the problem would be solved better and in a more flexible way, should you?

Countif(s) criteria is a range plus a number

I would like to countif(s) a range is greater than another range plus 3.
Here is what I currently have that isn't working (only the 3rd criteria isn't working):
=COUNTIFS($F:$F, ">" &G:G,F:F, ">1",F:F, "<" &G:G+3)
Isolating the issue to a single row works, a la:
=COUNTIF(F12, "<" &G12+3)
I am trying to get the countifs to check if an F cell in a given row is less than a G cell +3 for the same row.
You need a formula that supports arrays for that, like the following, entered with ctrl+shift+enter, instead of the regular Enter
=SUM(IF(ISERROR(--$F1:$F100),0,IF(ISERROR(--$F1:$F100),0,IF($F1:$F100>G1:G100,IF(F1:F100>1,IF(F1:F100<G1:G100+3,1,0),0),0))))

Resources