Countif Nested Conditions
Aug 28, 2007
I just need it to be able to test two seperate conditions on two seperate columns but i cant work out how its done
for example, i have two columns on a sheet, one called type and one area, both are text, i need to count how many items of one type are in a particular area. so if i have two columns "area" and "type" i want a total count of how many rows contain area="north" and type="b"
View 13 Replies
ADVERTISEMENT
Mar 16, 2007
I searched on this and didn't find what I was looking for. I want to count entries that have critieria I specify in two different ranges. Is countif the way to do this?
View 9 Replies
View Related
Oct 8, 2009
Hi guys, hopefully you can shed some light onto this small problem I am having.
The current formula I'm trying to use is:
=IF(VLOOKUP(A4,EPG1!D4:AN26,6,FALSE),COUNTIF(PASS,""))+IF(VLOOKUP(A4,EPG1!D4:AN26,6,FALSE),COUNTIF(F AIL,""))
This isn't producing the desired results.
What I am trying to do in words is this:
IF... in this array it equals A4 then look at coloum 6 and then Countif col 6 says Pass and then add another if it says Fail....
View 7 Replies
View Related
Apr 13, 2007
I'm working on a formula that will determine the lowest number in a range.
The complication is that the range varies based on how many rows match a certain criteria.
The formula I have created works correctly, however, I need to have the range go up to 10, and because of the limit of 7 nested IF's, I have to stop at 6.
=IF(A2=A1,"",IF(COUNTIF($A:$A,A2)=1,G2,IF(COUNTIF($A:$A,A2)=2,MIN(G2:G3),IF(COUNTIF($A:$A,A2)=3,MIN(G2:G4),IF(COUNTIF($A:$A,A2)=4,MI N(G2:G5),IF(COUNTIF($A:$A,A2)=5,MIN(G2:G6),IF(COUNTIF($A:$A,A2)=6,MIN(G2:G7),"")))))))
After a result is returned from this formula, I have to do the almost exact same formula, based on the min value from these results.
View 9 Replies
View Related
Mar 16, 2008
I have a student grade worksheet with this formula and it returns # DIV/0 which I need to solve the problem. I have tried many different ways and none seem to work. Con someone assist with this problem. Here is the formula:
= SUM(R13,R55,R97,R139,R181)/(COUNTIF(R13,">0")+(COUNTIF(R55,">0")+(COUNTIF(R97,">0")+(COUNTIF(R139,">0")+(COUNTIF(R181,">0"))))))
View 9 Replies
View Related
Jul 14, 2009
I have the data in this form
YYY
NYY
NYY
NNY
NYY
NNY
NYY
NYY
NYY
NYY
YNN
NNY
NNN
NYY
The output should check two conditions. If all three columns are "Y" then it should return value "Y". If any two columns are "Y" then it should return value "Y". or else it should return "N". Then the output should look like this.... The output column is colored in Red..........
View 5 Replies
View Related
Apr 9, 2009
I've been using nested IF statements, with success for a while, but now I'm into my fourth nested statement I'm starting to get some problems.
=IF($P15>0,SUM(IF(APR09!$M$2:$M$500=Department!$M$1,IF(APR09!$B$2:$B$500=$Q$6,IF((AND(APR09!$G$2:$G$ 500<>Department!$N$29,APR09!$G$2:$G$500<>Department!$N$30)),1,0),$N$2))))
Is what I've come up with so far. However, this returns 0, even though there are 3 items which should resolve the criteria. The main problem is here: IF((AND(APR09!$G$2:$G$500<>Department!$N$29,APR09!$G$2:$G$500<>Department!$N$30))
Where I am trying to make the sum increase by 1 if the cell from the row in question, having made it through the first 3 IF statements is not equal to either of those two cells (a range would be better) then the Sum needs to be increased by 1.
View 3 Replies
View Related
Jun 10, 2014
I am trying to produce a report of supplier transactions sorted by area code. I have a spreadsheet of data consisting of Supplier Code, Supplier Name, Transaction Amount and Area Code.
I want to be able to firstly seperate the transactions by area, then also consolidate the data so it shows one row per supplier with total amount spent on that supplier and a transaction count on that supplier. I know how to sumif the transaction total and countif the transaction count.
However I have problems consolidating the suppliers in to one row per unique supplier and I also have problems nesting an AND statement in to the sumif/countif statements. I need additional criteria in the forumula to only count transactions in a specified area code.
I've attached an example spreadsheet to make it alot clearer. See results sheet in this workbook.
View 3 Replies
View Related
Nov 26, 2008
I am trying to track metrics for a QC dept. Right now my sheet has 35 lines of data and a header row, for 36 lines total. This is my funtion that isn't quite right:
View 2 Replies
View Related
Mar 6, 2013
It's actually a sumif/countif that works fine if i sort my table, which i don't want to do.
Here's the original formula:
Code:
(SUMIF(H4:H35,"1",G4:G35)/COUNTIF(H4:H35,"1")*1+SUMIF(H4:H35,"2",G4:G35)
/COUNTIF(H4:H35,"2")*2+SUMIF(H4:H35,"3",G4:G35)
/COUNTIF(H4:H35,"3")*3+SUMIF(H4:H35,"4",G4:G35)
/COUNTIF(H4:H35,"4")*4)/10
I'm trying to apply the formula using some other filters, like if(C4:C35=O5 & I4:I35=M5).
I tried creating a SUMPRODUCT out of it but it was just as bad:
Code:
=(SUMPRODUCT((C4:C35=$O$5)*(I4:I35=$M$5)*(H4:H35=1)*(G4:G35))
/SUMPRODUCT((C4:C35=$O$5)*(H4:H35=1)*(I4:I35=$M$5)*1)*1+...
And also this with sum(if)
Code:
=(SUM(IF(C4:C35=$O$5,IF(I4:I35=$M$5,IF(H4:H35=1,G4:G35))))
/COUNT(IF(C4:C35=$O$5,IF(I4:I35=$M$5,IF(H4:H35=1,G4:G35)))))*1+...
Is there a shorter formula that I'm not seeing ? I'm also confronted with the need of adding an "ISERROR" in the formula because not all ranges have the 1-4 numbers in column H.
View 9 Replies
View Related
Aug 16, 2009
I thought that a nested if is what I needed, but now I don't know what I need I have explained in greater detail within my sample that's attached. Quote:....
I don't know how to write a function for what I need. Right now I have a function that says '= if $b7=0,0,if($d7>$d5,-1,1)), but I've found a problem. If there's more than one zero it throws off what I'm doing. I need a function that will ignore any zeros within column D and use the second to last number. For example:
The formula in E12 should read '=if($B12=0,0,if($D12>$D8,-1,1))
The formula in E13 should read '=if($b13=0,0,if($D13>$D9,-1,1))
The formula in E20 should read '=if($b20=0,0 ,if($d20>$d12,-1,1))
I just don't know how to write this so that it will go back to the second to last number other than zero.
View 3 Replies
View Related
Jan 29, 2009
I want to auto fill certain columns in sheet A from sheet B & sheet C based on conditions
For Eg:
Sheet A:
Position#
Position Name
Personnel Name
Personnel No.
AB1
Manager
AB2
I want to auto fill in Sheet A for the columns:
Personnel Name
Personnel No.
Conditions:
If the employee is active in Sheet B then fill in Sheet A to the related position No.
Else
If the employee is mapped to org. (Yes) in Sheet C then fill in Sheet A to the related position No.
Else
Vacancy
i have written the below formula but not working properly:
=IF(VLOOKUP(SheetA!A4,Direct!A$2:K$16,5,FALSE)="Active",VLOOKUP(SheetA!A4,Direct!A$2:K$16,3,FALSE),IF(VLOOKUP(SheetA!A2,Contractors!A$2:K$15,5,FALSE)="Yes",VLOOKUP(SheetA!A2,Contractors!A$2:K$15,3,FALSE),"Vacancy"))
View 9 Replies
View Related
Dec 4, 2013
I'm logging failed password attempts and need to find the latest time logged for a single user (when user has failed 5 times).
So the 5th attempt, I need that time
So the usual - Application.UserName in the next free cell in a range and time stamp in the next cell.
What I've tried is:
Say log range is A1:B500 and
A=Username, B=Time stamp
In column C I've nested the two together
(this has more code but not required to get this working)
In C1
Code:
=A1&" "&"live"&" "&B1
So this will bring back "Username live 23:12:12". Now, say there is 5 of these (all with different times)
How do I find the latest time for that user?
Code:
IF(COUNTIF("USERNAME LIVE"&"*")=5,[find the latest time in that list",""
Just to wind you up some more, other users name will be logged and muddled up so it's literally -
"Excel - if a user has failed 5 times then give me the time of the 5th attempt"
I've tried a mixture of COUNTIF, MAX, LARGE, TIMEVALUE(...)
View 4 Replies
View Related
Feb 11, 2010
I am trying to create a COUNTIF formula which will work with two conditions. If you see the attached spreadsheet you will find the data that I am trying to apply a formula to. I have my data in the table on the right. The table on the left is supposed to show the number which the number of destinations that had a certain range of visitors.
As you will see that there are 3 destinations that had 12 or more million visitors, this was counted using a basic COUNT IF formula but for the rest of my data how can I apply the formula so that the correct number of destinations are counted. For example what formula would be needed to count the number of destinations that have had 8-11.9 million visitors. I am guessing that the formula will have the conditions ">=8" and "<=11.9"?
View 3 Replies
View Related
Dec 5, 2013
I have coded data for age range in one column and for answering yes or no to a question in a different column. I need a formula that will count the number of yes answers for each coded age range.
a= 14-15 years old, b=16-17, ect.
Column One Column Two
age(coded) Yes or No
a Y
a N
b N
c Y
a Y
b N
I need to be able to count the number of yeses for each coded age. If the formula works it should give me the following output given the sample data above.
14-15 year olds output with the data above would be 2
16-17 year olds output would be 0.
How would I write this formula? I tried countif and sumproduct (though admittedly sumproduct I don't know at all and just tried to find a similar situation and tried it with my spreadsheet).
View 5 Replies
View Related
Nov 16, 2008
I have a table like this:
Name (A).....Date-in (B)....Date-out (C)
Name1........27/12/2008....3/01/2009
Name2........25/11/2008....28/11/2008
...
I want to count the rows (in the entire table) that B and C dates intersect with a reference dates (say J1 and J2).
It is a booking table so I want to know if the apartment is available for the reference dates (i.e. no bookings for that days).
I tried first a simple double conditional to know if a date is inside two dates but it didn't work:
=SUMPRODUCT(--(B:B<J1),--(C:C>J1))
View 9 Replies
View Related
Apr 14, 2009
In my Sheet "List" I have list of persons working on different projects.
I prepared graph after putting conditions on Project Type, Project Size, Project Year & Position (PM Project Manger). Every thing was done a in a nice manner with the help of below formula.
PJ TYPE , PJSIZE, PJYEAR, POSITION are ranges names.
=SUMPRODUCT(--(PJTYPE=$A$2),--(PJSIZE=$A6),--(PJYEAR=B$4),--(POSITION="PM"))
But the problem was occured that in a year if a person work on small project more than once then he will be counted only once. But if he has worked in same year on Medium or Larage project then they will be counted separately. I tried to oversome the problem with the help of Pivot Table and put manually some legend P1, P2 & P3 against the person name if he is working on same type of project in same year. then count only P1 in my formula to count how many Project Manager worked on Project. like
=SUMPRODUCT(--(PJTYPE=$A$2),--(PJSIZE=$A6),--(PJYEAR=B$4),--(POSITION="PM"),--(PMCOUNT="P1"))
Now i am trying that in a separate columm of # of PM there must be a formula which only put P or 1 for a person if he is working on same project in a year but i want that p or 1 only appear against his first entry i duplicate. for other persons it automatically enter 1 or p if they are appearing only once. i have tried a lot while using countif with multiple conditions but all in vain.
View 3 Replies
View Related
Apr 23, 2013
I've come across this page around simulating a countif with two conditions. Instead of two 'equal to' statements though, one is a 'less than' statement, and something does not seem to be right - I am not sure if I am getting the syntax wrong but am currently just getting #VALUE! across all cells I try and use.
Currently I have;
Code:
=SUM(IF(Data!$T:$T=$E3,IF(Data!$V:$V&"
View 8 Replies
View Related
Jul 15, 2006
example of what I'm trying to do:
"if the number in G6 is <800 and H6 is >=20 then count the row as 1"
View 9 Replies
View Related
Apr 2, 2008
I am using =COUNTIF formulas to calculate different conditions. such as, calculating how much of one product do we have and how much is is received under 30 days. i want to combine those formulas in one cell to calculate two conditions in different columns.
1-So first i found out the date difference. I used =DATEDIF(Sheet1!C10,Sheet1!E10,"d")
2-Then I found out how many of one type do we carry, using the =COUNTIF.
=COUNTIF(Sheet1!J2:J3810,"DAZ")
3-That was easy, But now i have to sepereate them into 30 or less, 60 days or less, 90 days or less.
Then i used =COUNTIF(D2:D3810,"
View 9 Replies
View Related
Mar 20, 2014
MS Excel Version : 2010
Attached File name : countif for 2 conditons a given month.xlsx
I want to a count with given 2 conditions AA11 / BB22 and xxx / yyy according to the month in yellow cells.
View 2 Replies
View Related
Jan 15, 2010
I want to be able to look at two columns and set a criteria to count. I want to look at column A and if its blank then look at column B and if it has a value of more than 0 then count.
A B
1 1.00
2 Yes 4.78
3
4 5.00
5 Yes 4.89
6 11.99
So this example would count 3
View 3 Replies
View Related
Aug 22, 2009
the traditional count if statement doesnt return what I need. I have an array of values that need to be checked.
Column: A B C D E
Data: .25 .49 .18 (Criteria 1 Result) (Criteria 2 Result)
What I need to do is check the data for the following conditions and if it meets the crirteria I need excel to place a 1 in column D or E.
Criteria 1
If any of the coulmn data contains a value less than .5 I need a 1 placed in column D
Criteria 2
If any of the column data contains a value greater than .5 but less than 1.0, I need a 1 placed in Column E. I tried using an IF/ Count If statement, but cant seem to get it to return the result I need.
View 5 Replies
View Related
Oct 17, 2007
I would like to highlight cells is two conditions are met:Cell = 0Offset(0,-1)>0I tried the conditional format wizard and entered a formula: =IF(AND($J2=0,$I2>0)) But I keep receiving formual errors, which I understand, because it appears to be incomplete formula. But I am not sure what else I need to add to the formula in the conditional format wizard
View 2 Replies
View Related
Dec 11, 2009
My objective is to replace a text string with a numeric variable. The string has text values such as US, Canada, Germany, France etc, There are about 15 such words in total. Each row will have a different one of the 15 text strings.
Each text string has a corresponding number, which I want to use in various formulas throughout the spreadsheet. The numbers are located on a separate worksheet (“Match Rate”), within the same workbook. I obtained the numbers from a formatted report, which I simply pasted into the second worksheet. Due to the complexity of the report, I can’t reformat the numbers to allow use of the VLOOKUP function.
I created the following function, but unfortunately it doesn’t work. Can you help, please?
I’d like to stay with a VBA solution, since a simple if/then sequence such as this is an excellent introduction to the powerful world of VBA... (it just doesn’t work, yet). I suspect the problem is in the calls to the Match Rate Worksheet.
View 11 Replies
View Related
Jan 17, 2008
Ok. Here's what I'm trying to do. I have a drop down menu of certain providers located on cell F5. Each one charges different rates per day located on another sheet. Here's the kicker two of those providers charge different rates depending on the amount of days. Those two are UASC and CMA. For the First 5 days they charge one rate and after the 5 days they charge an increased rate.
I'm trying to have one cell located on the first sheet display this information with all the proper calculations. The below formula gives me a false value. I'm not even sure if it works. I know a little bit of excel through some intro courses in college but I'm not sure if a formula like this would work. I know laugh it up.... : ) but I'm not too saavy with formulas....
View 9 Replies
View Related
Jul 8, 2008
I have a total of 30 nested formulas that (ofcourse) dont work in excel.
Here is an example of the first 7 nested IFS
(1) IF(MID(A7,8,9)="GIR",INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0)),
(2) IF(MID(A7,8,9)="NL",INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0)),
(3) IF(MID(A7,8,9)="BE",INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0)),
(4) IF(MID(A7,8,9)="AT",INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0))
(5) IF(MID(A7,8,9)="DE",INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0))
(6) IF(MID(A7,8,9)="PH",INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0))
(7) IF(MID(A7,8,9)="AUBE",INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0))
I tried this code but it is not working.
Function LookupRetrieve(pVal As String) As Long
If pVal = "(MID(A7,8,9)="GIR" Then
LookupRetrieve = INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!
C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0))
ElseIf pVal = "(MID(A7,8,9)="NL" Then
LookupRetrieve = INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!
C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0))
ElseIf pVal = "(MID(A7,8,9)="BE" Then
LookupRetrieve = INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!
C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0))
ElseIf pVal = "(MID(A7,8,9)="AT" Then
LookupRetrieve = INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!
C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0))
ElseIf pVal = "(MID(A7,8,9)="DE" Then
LookupRetrieve = INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!
C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0))
ElseIf pVal = "(MID(A7,8,9)="PH" Then
LookupRetrieve = INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!
C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0))
ElseIf pVal = "(MID(A7,8,9)="AU" Then
LookupRetrieve = INDEX('ERIS INPUT'!$C$2:$C$65536,MATCH(A7,IF(Reconciliatie!
C$3:C$65536=C7,Reconciliatie!A$3:A$65536),0))
Else
LookupRetrieve = "isingcode missing"
End If
End Function
The formula is a vlookup formula (Index/Match but with multiple criterias such as the use of Mid).
I tried Concatenate but the formula is too long and has a lot of characters and VBA seems better.
View 9 Replies
View Related
Dec 7, 2009
I'm building a macro and need to know how to add a nested if-then statement. I need to create a formula in a new column whose value extends to the last row of the database. My base formula is sumproduct(--((A2:A:last row which I need to calculate&B1:B same thing)=A2&A2))
View 9 Replies
View Related
Mar 20, 2014
I am trying to make this work. VLOOKUP (B2,"lookup tables'!$A$4:$A$11, if(D2'="ST" 'lookup tables!$C$4:$E$11.
I am attaching the file : MDCC Reservations.xlsx
I am trying to get the Daily room charge.
View 5 Replies
View Related
Jun 30, 2014
I am trying to write a formula that will satisfy the following:
C1 and G1 are number values.
IF (cell E1 does not contain any text) AND (G1-C1-12.5>=0), then output (G1-C1-12.5), otherwise output nothing (""). BUT, IF (cell E1 DOES contain text) AND (G1-C1-13>=0), then output (G1-C1-13), otherwise output nothing.
View 2 Replies
View Related