Count occurrances with conditions

I am trying to count in 3 columns.   Column A will have entries of "B
or "S" and columns B and C will have "1" or "0". 

A               B           C
B                0           1
B                1           0
B                1           1
S                1            1

I want to count how many times column C has a 1 with a B or S.  That i
no problem, I can do that.  I also want to count the number of time
column B has a 1 with a B or S.  That is no problem, I can do that.
However, the third count I want to count is when a 1 appears in bot
column B and C, I want ONLY to count the occurrance in column C.  I CA
NOT figure that out.

These are the formulas I am using for single occurrances. 
=SUM(IF(C18:C38="B",IF(R18:R38>0,1,0)))
=SUM(IF(C18:C38="S",IF(R18:R38>0,1,0)))

I enter them with SHIFT/CTRL/Enter

Can anyone help?  Thanks!!

--
WM
-----------------------------------------------------------------------
WMO's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2606
View this thread: http://www.excelforum.com/showthread.php?threadid=39403

0
8/8/2005 9:19:14 PM
excel 39879 articles. 2 followers. Follow

5 Replies
708 Views

Similar Articles

[PageSpeed] 30

=SUMPRODUCT(--(C18:C38="B"),--(R18:R38=1),--(S18:S38=1))


-- 

HTH

RP
(remove nothere from the email address if mailing direct)


"WMO" <WMO.1tguef_1123538706.037@excelforum-nospam.com> wrote in message
news:WMO.1tguef_1123538706.037@excelforum-nospam.com...
>
> I am trying to count in 3 columns.   Column A will have entries of "B"
> or "S" and columns B and C will have "1" or "0".
>
> A               B           C
> B                0           1
> B                1           0
> B                1           1
> S                1            1
>
> I want to count how many times column C has a 1 with a B or S.  That is
> no problem, I can do that.  I also want to count the number of times
> column B has a 1 with a B or S.  That is no problem, I can do that.
> However, the third count I want to count is when a 1 appears in both
> column B and C, I want ONLY to count the occurrance in column C.  I CAN
> NOT figure that out.
>
> These are the formulas I am using for single occurrances.
> =SUM(IF(C18:C38="B",IF(R18:R38>0,1,0)))
> =SUM(IF(C18:C38="S",IF(R18:R38>0,1,0)))
>
> I enter them with SHIFT/CTRL/Enter
>
> Can anyone help?  Thanks!!!
>
>
> -- 
> WMO
> ------------------------------------------------------------------------
> WMO's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=26065
> View this thread: http://www.excelforum.com/showthread.php?threadid=394033
>


0
bob.phillips1 (6510)
8/8/2005 10:36:14 PM
Trying to reach Bob Phillips who logged on as a guest.  I appreciat
your response but it did not resolve my issue.  I have now attached 
portion of the spreadsheet with more detail.

If you (or anyone else) can make an additional response, I would
greatly appreciate it.  Thank

+-------------------------------------------------------------------
|Filename: excel forum.zip                                          
|Download: http://www.excelforum.com/attachment.php?postid=3678     
+-------------------------------------------------------------------

--
WM
-----------------------------------------------------------------------
WMO's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2606
View this thread: http://www.excelforum.com/showthread.php?threadid=39403

0
8/9/2005 2:45:31 AM
I didn't sign on to the forum as a guest, I didn't come to the forum at all.
Your forum questions are automatically forwarded to the Microsoft Public
newsgroups which is where I see them.

Anyway, try this alternative

=SUMPRODUCT(--(C17:C37="B"),--(Q17:Q37=1),--(R17:R37<>1))

for bulk items

-- 
 HTH

Bob Phillips

"WMO" <WMO.1th8ad_1123556707.0352@excelforum-nospam.com> wrote in message
news:WMO.1th8ad_1123556707.0352@excelforum-nospam.com...
>
> Trying to reach Bob Phillips who logged on as a guest.  I appreciate
> your response but it did not resolve my issue.  I have now attached a
> portion of the spreadsheet with more detail.
>
> If you (or anyone else) can make an additional response, I would
> greatly appreciate it.  Thanks
>
>
> +-------------------------------------------------------------------+
> |Filename: excel forum.zip                                          |
> |Download: http://www.excelforum.com/attachment.php?postid=3678     |
> +-------------------------------------------------------------------+
>
> -- 
> WMO
> ------------------------------------------------------------------------
> WMO's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=26065
> View this thread: http://www.excelforum.com/showthread.php?threadid=394033
>


0
bob.phillips1 (6510)
8/9/2005 8:08:58 AM
Bob.....thanks very much.  That works perfectly.  Seems so simple once 
see it.  I suppose everything is simple when you understand. I ha
tried, at least, 4,000 variations of my knowledge.....nothing worked.
I was getting totally frustrated.

I found the Excel forum site.  Had never used it before so was no
aware of how it worked.  Did not realize you came from "somewher
else", but am I glad you did!

You have impressed everybody who sits around me.  We all had trie
something but it (they) never worked.  I need to brush up on SUMPRODUC
and will certainly do that.

Again, thanks VERY MUCH for your help.  You, indeed, saved the day fo
us

--
WM
-----------------------------------------------------------------------
WMO's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2606
View this thread: http://www.excelforum.com/showthread.php?threadid=39403

0
8/9/2005 12:48:27 PM
If you want to brush up on SUMPRODUCT, take a look at
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

-- 
 HTH

Bob Phillips

"WMO" <WMO.1ti05p_1123592833.7731@excelforum-nospam.com> wrote in message
news:WMO.1ti05p_1123592833.7731@excelforum-nospam.com...
>
> Bob.....thanks very much.  That works perfectly.  Seems so simple once I
> see it.  I suppose everything is simple when you understand. I had
> tried, at least, 4,000 variations of my knowledge.....nothing worked.
> I was getting totally frustrated.
>
> I found the Excel forum site.  Had never used it before so was not
> aware of how it worked.  Did not realize you came from "somewhere
> else", but am I glad you did!
>
> You have impressed everybody who sits around me.  We all had tried
> something but it (they) never worked.  I need to brush up on SUMPRODUCT
> and will certainly do that.
>
> Again, thanks VERY MUCH for your help.  You, indeed, saved the day for
> us.
>
>
> -- 
> WMO
> ------------------------------------------------------------------------
> WMO's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=26065
> View this thread: http://www.excelforum.com/showthread.php?threadid=394033
>


0
bob.phillips1 (6510)
8/9/2005 1:25:04 PM
Reply:

Similar Artilces:

Conditional Formatting
I have read & tried several CF solutions, but they are not working for me. I am working with Today() date, Due_Date, & days_late. I have a formula in the days_late column =IF(OR(TODAY()<Due_Date,J9="COMPLETED")," ",TODAY()-Due_Date). This formula gives me days_late or leaves that column blank (" "). I want 5 cells to turn red if days_late>1. All my attempts at CF have also turned the blank (" ") cells red also. I have tried ISBLANK and NOT(ISBLANK). -- pls Your problem is that " " is not blank. I know it looks...

IF conditional statements
Hi, It's my understanding that I can nest up to seven levels of the IF functions within one formula. My question is how does one nest over seven levels? Below is the actual code without adding the additional IF statements. =IF(D8=" "," ",IF(D8=$L$81 Then +Insured!$G$38-Worksheets!D45,IF(D8=$L$82,+Insured!$G$40-Worksheets!D45,IF(D8=$L$83,+Insured!$G$42-Worksheets!D45,IF(D8=$L$84,+Insured!$G$44-Worksheets!D45))))) Here's is an example of over sevel levels where I like to add to the cell, but again I cannot because Excel only nest up to seven levels. =IF(D...

Pivot table and counting.
I have a pivot table that gives me the number of rides done by a van. I can have the pivot table return the number of rides, but what I need is the number vans that participated for a certain day. Example, it is possible to have 27 trips done by 18 vans, how can I count the number of vans and not addup the van number? Any help appreciated. Thank you, Joe Hi Joe We need a bit more information on how your source data table is set up. What information do you have in each column? -- Regards Roger Govier sacredarms <sacredarms@discussions.microsoft.com> wrote: > I have a pi...

Cycle Counting
Hello, I am looking for ideas on how to cycle count serial number tracked items without increasing workload. Our serialized items are barcoded but the problem is the are situated on the pallet incorrectly and the pallet is placed on a third level of a racking system. If we could just cycle count based on item count and not include the serial number it would make it easy. Is this possible in Great Plains. We are running Great Plains 8.0. Any suggestions are greatly aprreciated. Thank You, Brian Morris Database Administrator ...

Count
Hi, I would like to know how which formula I should use to count some codes & to ignore the duplicated codes, for example in column A: Code 1234 4321 4321 1234 1234 3214 Now, I want Excel to count & the result is 3 which are: 1234-4321-3214 Yes I can use PivotTable, but I would like to use a formula because I have to deal with this every day. I appreciate your support. -- MFS22 COUNTIF will do it. =COUNTIF(Rng,Rng), where the criterion is the same as the range: e.g =COUNTIF(A3:A8,A3:A8) HTH Peter "MFS" wrote: > Hi, > I wo...

How do I count the # of times a value reoccurs and plot it over ti
I wish to plot a number of errors made by each users and compare it over time. I have a column of user ID's and a column of dates. I want the chart to count the number of times each user ID appears and plot against it's corresponding date. However, each time I try to do this, the chart appears wrong. Any ideas? In article <9595B2A1-8282-4AB3-8511-A6776E108164@microsoft.com>, Stephen@discussions.microsoft.com says... > I wish to plot a number of errors made by each users and compare it over > time. I have a column of user ID's and a column of dates. I want t...

Line count
I am working with a program called Dictaphone. We use Word 2007 in this program. The line count on Dictaphone and the line count in Word 2007 are different even though the Dictaphone text is retrieved from Word 2007. Why would they be different? What is the difference between virutal line count and physical line count? ...

count number of characters in rich edit control
How can i count number of characters in rich edit control 2 If u mean controls of type Rich TextBox control, try RichControl1 RC1; CString Mes=RC.GetText(); int n=Mes.GetLength(); "Rahul" <Rahul@discussions.microsoft.com> wrote in message news:7743023C-EA83-4ACA-AB67-F1AE7279F1EB@microsoft.com... > How can i count number of characters in rich edit control 2 EM_GETTEXTLENGTHEX, WM_GETTEXTLENGTH, WM_GETTEXT, EM_STREAM* "Rahul" <Rahul@discussions.microsoft.com> wrote in message news:7743023C-EA83-4ACA-AB67-F1AE7279F1EB@microsoft.com... > How can i co...

Conditional addition
Let's say I have four rows across, Activity, Budget, Revenue and Priority. I will have many rows beneath them, with lots of text under activity and numbers under budget, revenue and priority. I sort on Priority, of which there are 4- priority 1, priority 2, etc. Is there a way I can add all the priority 1s together, all the 2s. etc? In such a way that if I change an activity's priority from 1 to 2 the sums for all the priorty 1 and 2s change at the same time? Sort of conditional addition? Sorry if this is really simple but I am a Word man and this excel stuff freaks me out - I do...

Counting sales
I have two different datasets. Each with a common identifier. I need a formula that will reference the identifiers in both datasets and count the number of sales a particular agent made. Example. look up this identifier in the other dataset and then give me the value that is 2 columns over from the identifier in the second dataset. See if this helps: http://contextures.com/xlFunctions02.html -- Biff Microsoft Excel MVP "Dave" <Dave@discussions.microsoft.com> wrote in message news:E7245B37-033F-400E-9CEE-9822BE7CB0F5@microsoft.com... >I have two...

Counting Cells with Conditional Formatting
Is there a way to look at a row of data that is either highlighted yellow or red and to count only the data that is highlighted yellow and give me that number? None of my data is numerical....just one letter data, i.e.: "S" or "U" I just want to count how many of the cells are highlighted yellow in a specific row, if that makes more sense. Here's a UDF (Put in a Standard module) and use it in cell A1, like =CountByColor(A8:H8,6) << where 6 (at present) = Yellow = change to =CountByColor(A8:H8,3) to get the reds HTH Function CountByColor(InRa...

COUNT ? need formula
Hi, I want to track the results of my teams sales performance. I record if it is a sale, no sale, cancelled etc in column M. I thought I'd be able to use the COUNT function/formula to be able to search for all the SALES in column M and place the result in a cell ( column O )but I can't work it out. Any ideas? Damian Hi! Try this: =COUNTIF(M1:M100,"sale") Biff "Diamond Jones" <kwanzaNOSPAM@optusnet.com.au> wrote in message news:43a0e897$0$17704$afc38c87@news.optusnet.com.au... > Hi, > > I want to track the results of my teams sales perf...

Count Function
I am creating a report for the number of pupils being collected at a certain collection time e.g. 14:00hr and 15:00hrs using the formula =Count([Child Last Name]) in the collection time footer However when i try to count the overall number of pupils in the footer using the same formula, 'Error' appears on screen? Thanks There are potentially a dozen footer sections in a report. Which one is giving you a problem? What is the name of the control? What is the exact formula? -- Duane Hookom Microsoft Access MVP "ELo" wrote: > I am creating a r...

Counting a count
How do I count a count?? This is what im trying to do: I have a database with a table named tblMain and has incorporated everything within that table but contains info from about 8 other tables. I have not doesigned this database and it appears to have a very poor structure...anyway There are three fields involved in this process...'Request' (either 'dispensation', 'waiver' or 'dispensation and waiver'), 'Department' (which consists of 7 other drop down menu options) and 'RequestStatus' which contains the status of each request by another...

Count Problem
Hi I have 20 cells in a single column in a sheet called "Audits" All the cells have a formula in them. The formula is a simple one that reads whatever I put into a cell on a different worksheet called "Names" ie: =Names!A1 = Names!A2 etc etc I would like to have a formula that counts up all the results I get in the sheet called "Audits" At the moment if I enter (let say) 15 names in the "Names" sheet the result is that I see the same 15 names in the "Audits" sheet, however the COUNTA formula returns a total of 20. SO obviously...

Conditional Data Validation
So I have two columns of Data Validations: Column A we'll call Cost Centers Column B we'll call Accounts If somebody puts in a Cost Center for a specific department which we will call Advertising, then a different list shows up in Column B of only Advertising Accts. I use the following formula in Column B for my Data Validation: =IF(ISERROR(VLOOKUP(A5,advertising,1,0)),accounts,advaccts) where "accounts" is all accounts and "advaccts" is only advertising accounts. That works ok. I'm sure that is not the best way of doing it; but here is my ...

unique or distinct count from xml
How to get a unique count from a xml <Orders> <Order ID="1111" Amount="200"></Order> <Order ID= "2222" Amount="10"></Order> <Order ID="3333" Amount="5"></Order> <Order ID="1111" Amount="20"></Order> </Orders> The result should be 3 unique count and the 4 Order Id counts. How can i get using XPathNodeIterator using Compile,Execute with a XPathNavigator thanks you bhu The XPath expression for that is count(Orders/Order[not(@ID=preceding-sibling::Or...

Replace Count
I am using this routine to replace characters in a large text string. I would like to know how many replacements have been made. This is a generalized routine for experimenting. If I set lReplCount = 1, I can get a count but it takes over one minute to run. If I set lReplCount = -1, it takes about 20 mSec but I get no count (except 1). Is there any way to get speed and the replace count? I would be happy with a few seconds and an accurate count. Do If InStr(1, sText, vbCr & vbCr) > 0 Then lChangeCount = lChangeCount + 1 ...

how: if, conditional test, true (do nothing if false)
I want a simply if then without the else. =if(Condtion,true response,"") will give a blank for a false response, is this what you mean? "jwhitney" wrote: > I want a simply if then without the else. We have daily and weekly (and monthly and biannual) checks, I want the date on the weekly to update (dd/mm/yy) on "Mon" but not change the rest of the week. "bj" wrote: > =if(Condtion,true response,"") > will give a blank for a false response, > is this what you mean? > > "jwhitney" wrote: > > > I want a...

Counting text cells #3
I have a range of cells A25:A256 that contain text entries of various types (doesn't matter). How do I get it in cell A258 to give me a total of cells that have text in them within that range 25:256 Thanks, Gurus Jessica =SUMPRODUCT(--(ISTEXT(A25:A256))) -- Regards, Peo Sjoblom "Jessica Walton" <jessica.w@zimshipping.com> wrote in message news:1E804A58-662A-47BA-B264-9EEE8A20994F@microsoft.com... > I have a range of cells A25:A256 that contain text entries of various types (doesn't matter). How do I get it in cell A258 to give me a total of cells that have ...

Smart List record count in 10.0 SP2
Hello, I'm wondering if anyone else has seen a situation in the standard smart list for Purchase Line Items returns a different line count in the window than on the bottom of the window in the status bar. For instance, a client requested a search using the view "Today's Expected Receipts", so the window shows 4 rows, but the status bar at the bottom shows 8. The search criteria look to be the same as in my local view. Trying it in my local view, I get the same results for other views under this object, for instance the window shows 13 rows, but the status bar shows ...

Cycle Count
Hi, Client running GP 10. I am setting up their cycle count schedules and have run into an issue that I can't get an answer for. Want to set up the count to give me the following quantity of items to count weekly: A - 15 Items B - 10 Items C - 5 Items I am unable to find a way to automate this. Any suggestions (besides buying other count software?). -- Jim Lines Sr. Microsoft Dynamics GP Applications Consultant Certified Microsoft Dynamics GP Specialist I don't think so Jim. The assumption behind cycle counting is that you'll count all your inventory at least once annual...

2 questions regarding count formula
If I have the following data A B C 1 Personnel group type p't number 2 Melinda 1 4 3 Sean 1 5 4 Melinda 1 6 5 Sean 2 30 6 Fay 3 8 7 Melinda 1 32 1. How shall I contruct my formula to count the number of data that satisfy the following criteria: 1. personnel is Melinda 2. group type is 1 3. ...

count
I have a report that I have been emailing help on with you guys. Everyone has been such a great help. My report is a 12 month rolling report, which is based off of a crosstab query. I need a field called count. This will count what months have data in them. So for example: Item Mth1 Mth2 Mth3 Mth4 Mth5 Mth6 Mth7 Mth8 Mth9 Mth10 Mth11 Cnt 12 2 0 0 0 0 3 3 6 2 0 6 The count being which months are > 0. Do I create this in my query or better off in my report? Thanks in advance KimP -- Message posted ...

Count occurrances with conditions
I am trying to count in 3 columns. Column A will have entries of "B or "S" and columns B and C will have "1" or "0". A B C B 0 1 B 1 0 B 1 1 S 1 1 I want to count how many times column C has a 1 with a B or S. That i no problem, I can do that. I also want to count the number of time column B has a 1 with a B or S. That is no problem, I can do that. However, the third count I want to count is when a 1 appears in bot column B and...