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
Related
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 .
Below is my Workbook Sheet1
Am expecting sheet2 like below,
Total Item column (Using countifs I can get but Sub_Item1,2 and 3 How do I use Match Index in Excel)
Use countifs to count total_item =COUNTIFS($A$3:$A$12,D3). For sub items use below formula. Then drag down and right as needed. If need to handle errors then use IFERROR() function.
=INDEX($B$3:$B$12,AGGREGATE(15,6,(ROW($A$3:$A$12)-ROW($A$2))/($A$3:$A$12=$D3),COLUMN(A$1)))
I want to count the number of cells that meet two conditions:
sheet ABC's A2:A100 should be equal to the value of sheet XYC cell A8
the cell value in range D2:M100 = 1
Originally, I tried to use this formula:
=COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$D$2:$M$100,1)
But this gave me error #VALUE
I then decided to use the following formula to count each column separately and add them together.
=COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$D$2:$D$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$E$2:$E$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$F$2:$F$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$G$2:$G$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$H$2:$H$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$I$2:$I$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$J$2:$J$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$K$2:$K$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$L$2:$L$100,1)+
COUNTIFS(ABC!$A$2:$A$100,XYC!A8,ABC!$M$2:$M$100,1)
I am wondering if there are any other ways that allows me to shorten my formula?
Thank you.
You can use a boolean structure inside SUMPRODUCT() or just SUM() if your version of Excel supports dynamic arrays (ms365):
=SUMPRODUCT((ABC!A2:A100=XYC!A8)*(ABC!D2:M100=1))
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)
Google sheets has a filter command with the syntax
=filter(Range, criteria 1, ... criteria n)
It returns an array.
How can I do this in excel?
Example: I have a range 2 columns wide, with Genus in column 1, and the full botanical name in column 2. This range is named bot_name
Elsewhere I have a cell C1 with "Abies", the genus name for the firs.
In Google spreadsheet I can do this:
=UNIQUE(FILTER(Bot_Name,REGEXMATCH(Bot_Name,C1)))
For each row in the range, FILTER includes it if REGEXMATCH returns true.
Filter and Unique are filter functions.
Filter is documented:
https://support.google.com/docs/answer/3093197
From this I should get the following list:
Abies balsamea
Abies concolor
Abies lasiocarpa var bifolia
Abies veitch
I suggest that you use formulas and not the Excel filter feature (which is very different from FILTER function you have mentioned), because I suppose you need that your filtered data change whenever you change the search expression (e.g. Abies).
First you need to check which values match your criteria:
I suggest that you use COUNTIF function - it enables you to use wildcards in your search expression - I add * at the end to find everything that starts with "Abies".
So formula in a helper column looks like this:
=IF(COUNTIF(A2,$C$2 & "*")>0,A2,"")
You can hide the helper column later.
Then you need to remove duplicates - so the next final formula will be a non-array formula:
=INDEX($D$2:$D$15,MATCH(0,INDEX(COUNTIF($E$1:E1,$D$2:$D$15),0,0),0))
Your sheet would now look like this with search expression in the cell C2:
Also use IFERROR to remove cells having error. Also you can use named ranges instead of $D$2:$D$15 to simplify the second formula.
Download the sample Excel sheet here.
This is more complicated than using FILTER function with array and I really miss this feature in Excel.