# Count Occurrences Based Condition In 2 Dynamic Columns

May 9, 2008

I have been trying the whole day to create a formula to solve this but I just can't get it. To make it simple, let's say I have column A filled with different people names, column B filled with Level of Complexity and column C with the Activity (work task) title. This table is fed dynamically, so the number of rows can vary from 2 to 2000.

What I want to do is count how many times a single name appears related to the same complexity, so I can tell how many "simple, medium or complex" tasks each person has in their work queue.

A simple table example would be:
colA colB colC
Dan Complex Build House
Dan Complex Build Shopping center
Dan Simple Take dog to walk
Jose Simple Clean desk
Maria Medium Paint office roof

Then, on another cell I'd like to have a formula automatically telling me that Dan has 2 Complex tasks and 1 Simple, and so on - considering number rows is not a fixed number. What I have so far is this: =SUMPRODUCT((Data!\$I\$2:\$I\$457="Dan")*(Data!\$L\$2:\$L\$457="Complex"))
But I need to tell a specific last row, and if the data worksheet gets updated with less data (say 450 rows) the formula breaks...

## Trying To Count Number Of Occurrences Based On Content Of Two Other Columns

Jan 30, 2014

I am working on a spreadsheet that will provide count of types of complaints for particular areas over a running time span. I have tried a multitude of formulas but not sure how to write any of them correctly. What I am trying to do is generate a count of area type by whether it is formal or informal. (i.e. I want to know if there are x formal finish issues vs. y informal finish issues and so on.) This information will get charted and be kept "real-time" user input.

Type
Description

Concern

Formal
Informal

[Code] ....

## Count Occurrences Of Adjacent Cells By Condition

May 8, 2008

I am attaching a sheet in which Data can be entered in cells C5 & D5 in "Calculation " sheet, depending upon the value of C5 it will count all the Occurrence of data of D5 in adjacent cell i.e. (one up & and one below of data of C5) . data will search in "PCM_PLAN" sheet in column " I ".
count will be given in E5 in "calculation sheet"

## Count The Number Of Occurrences From 2 Columns

Mar 29, 2007

Look at 2 columns and assess if certain criteria and then count the number of these certain criteria. I give an example below:

Column 1: Has a drop down box of possibilities from: "Red", "Amber", "Green", N/A

Column 2: Has a drop down box of possible choices of: "Significant", "Other".

What I would like to do is have a formula which will count the number of times you have "Red and Significant", "Red and Other", "Amber and Significant", "Amber and Other", "Green and Significant", "Green and Other" and "N/A and Significant" and "N/A and Other".

## Count Rows Between Occurrences In Multiples Columns

Dec 24, 2006

How do I create a code that record on row 1012, starting with column N, will count the number of rows between each "0" record in the range F7:F106. Perform the same function for number "0" in the range G7:G106 and recording in N1013.

Perform the same function for number "0" in the range H7:H106 and recording in N1014. Perform the same function for number "0" in the range F7:H106 and recording in N1015.

## Count Occurrences In Worksheet Based On Data In Another Cell

Mar 14, 2014

I have my workbook set up so that one worksheet contains the names of all my departments/sections listed with their 3 letter code (this can be anything from AAA-ZZZ, e.g 'FYH', 'JWK' or 'KZA' are all valid) in Column F. I then have Columns H, I, J & K blank and require them to be auto-filling based on data from 4 other worksheets - i'll detail what i need below, but Column H needs to be filled based on what it finds in worksheet 'Data 1', Column I should be filled based on what it finds in worksheet 'Data 2' etc. etc. I have four further worksheets that contain data based on the types of assets owned by the department/section, these are 'Data 1', 'Data 2', 'Data 3' and 'Data 4' and I use these as described above, with Column H referring only to 'Data 1', Column I only to 'Data 2', Column J only to 'Data 3' and Column K only to 'Data 4'.

What i need then, is a VBA that will take the value of a cell in column F on my main worksheet (called 'main') and then count the number of occurences of that value in Coulumn A on another worksheet and place the number of occurences into Column H, I, J or K based on which sheet it's checking.

For example, Cell 'F2' on my main worksheet contains the value "ABC". I need to take "ABC" and search Column A of worksheet "Data 1" to find how many time it occurs, placing the result into Column H of worksheet 'Main', I then need the same value to be counted in Column A of 'Data 2' and its result placed into Column I on 'Main', and again for Column A of 'Data 3' with the result being put into Column J of 'Main', and finally Column A of 'Data 4' to be checked and that result placed into Column K on 'Main'.

does this seem too much of a task for VBA? or am i best doing each column separately with a CountIf or Array formula?? Not sure whether a COUNTIF or Array formula will do the job.

## Count Number Occurrences Based On Criteria Column

Feb 5, 2013

I get this work a lot and am looking for a much more effective way of working the dataset,

I have numbers like 1.1, 1.2, 1.3 and so on.......
These come under criteria like (1) = 1.1, 1.2, 1.3 and so on.....

I am look for an automated way of doing a count of any number that falls under this criteria, so I want to count based on criteria (1) it would count all 1.1,1.2,1.3 and so on as one count.

I am attaching a sample document to see how it is laid out. [URL] .....

## Count Occurrences Based On Unique Values In Another Column

Mar 18, 2013

I've got two columns, one with policy numbers, the other with error codes.

A policy could be in the list more than once, so I'm counting the number of unique policy numbers with the function

=SUM(IF(FREQUENCY(A10:F10000,A10:A10000)>0,1))

I want to count the number of errors that are NOT code 00 or code 21. Because the error codes are saved as text, I'm counting the number of errors with

=SUMPRODUCT((B10:B10000"21")*(B10:B10000"00")*(B10:B10000""))

The problem is that since a policy number could be listed twice, when I count the errors, I might be counting the same policy as an error twice. This means that I could feasibly end up with more errors than I have unique policies, which doesn't work.

What I'd like to do is only count the number of errors that have unique policy numbers. That is, I only want to count an error the first time it is in the list, based off it's policy number. Is that possible?

Here's my sample data: [URL]

## Count Occurrences In Worksheet Based On Data In Another Cell

Mar 14, 2014

I have my workbook set up so that one worksheet contains the names of all my departments/sections listed with their 3 letter code (this can be anything from AAA-ZZZ, e.g 'FYH', 'JWK' or 'KZA' are all valid) in Column F. I then have Columns H, I, J & K blank and require them to be auto-filling based on data from 4 other worksheets - i'll detail what i need below, but Column H needs to be filled based on what it finds in worksheet 'Data 1', Column I should be filled based on what it finds in worksheet 'Data 2' etc. etc. I have four further worksheets that contain data based on the types of assets owned by the department/section, these are 'Data 1', 'Data 2', 'Data 3' and 'Data 4' and I use these as described above, with Column H referring only to 'Data 1', Column I only to 'Data 2', Column J only to 'Data 3' and Column K only to 'Data 4'.

What i need then, is a VBA that will take the value of a cell in column F on my main worksheet (called 'main') and then count the number of occurences of that value in Coulumn A on another worksheet and place the number of occurences into Column H, I, J or K based on which sheet it's checking.

For example, Cell 'F2' on my main worksheet contains the value "ABC". I need to take "ABC" and search Column A of worksheet "Data 1" to find how many time it occurs, placing the result into Column H of worksheet 'Main', I then need the same value to be counted in Column A of 'Data 2' and its result placed into Column I on 'Main', and again for Column A of 'Data 3' with the result being put into Column J of 'Main', and finally Column A of 'Data 4' to be checked and that result placed into Column K on 'Main'.

does this seem too much of a task for VBA? or am i best doing each column separately with a CountIf or Array formula?

## Count Unique Occurrences Based On Multiple Conditions In Another Cells

Sep 19, 2013

I am trying to count the number of unique entries in a sheet, that also satisfy 2 other conditions.

I've attached an example sheet : Example email report.xlsx

The result I need is: The number of unique values in column E, that also have NULL in column G and NULL in column I.

So, in the example, the result would be 7.

I know I can do this by conditional formatting and filtering, but would prefer a formula, and perhaps also a macro that I could apply as the number of rows in each sheet is up to 20000, and each month's sheet will be a different size.

## How To Count Condition Based On Having Another Condition

Apr 12, 2014

So I have one sheet that needs to pull data through to another sheet (which is a stats summary)

I have a drop down list containing 4 options all of which have to be counted separately on the stats summary sheet. However I only need them counted when a value is input in another cell in that row.

For example: I select option 1 from down down menu, but I only want this to be counted on the stats page when I enter a date in the "date" cell.

## Count On Condition From Two Columns

Jul 2, 2009

I have a column with different cities that customers visit (Barcelona, Lisbon etc) and another column with their booking requirements (All inclusive, breakfast only etc)

I'd like to set up a count on the total number of customers who are going to Barcelona and having all inclusive.

I've tried using nested if statements with vlookups and a countif but can't seem to get that working.

## Count Multiple Columns Meeting Condition

Dec 21, 2004

I have a column (A) in sheet1 with these values:

Code
a1 04800128
a2 04800178
a3 04800128
a4 04805555
a5 04800128

And in Sheet2 - Column A and B has these values

Code
a1 04800128
a2 04800128
a3 04805555
a4 04800128
a5 04800128

Status
b1 Y
b2 Y
b3 Y
b4 Y
b5 N

I need to count in sheet1, where the code of sheet1 will be matched with sheet2 code and its status should be equal to "Y" .. I do not want to hard code these values as I have a huge data.

## Count Total Based On Condition.

Jan 18, 2010

I need a formula that will return a total for the number of cases that have been closed within 6 months. Also I need a percentage total for number of cases that have been closed within 6 months. So the conditions are that the case has been closed and within 6 months.

I tried to use a IF formula that returned a 1 if within 6 months and a 0 if outside 6 months and then just SUM() the column, however for some reason that just returns 0. I am using Excel2003

## Count Specific Criteria Based On Another Condition?

Jan 3, 2013

I'm trying to create a formula that tells me the following:

If the item is marked as closed (vs. active), then how many renewals/terminations replacements/etc are there? These are two difference columns in a worksheet.

## List/Consolidate All Occurrences By Condition

May 24, 2008

Because file size is large therefore I have uploaded the file to megaupload. Click the weblink below:

[url]
Is there formula or UDF which I can use in Column W in Pivot by Week worksheet tab so that I can consolidate all jobs for machine based on shift by day?

Have look in Column W in Pivot by Week worksheet tab for a sample for desired solution.

For Instance, in cell W7 I have used manual formula to consolidate all jobs for G16 Day.

=C9&", "&C10&", "&C18&", "&C19&", "&C20&", "&C21&", "&C23&", "&C24&", "&C25&", "&C32&", "&C36&", "&C37

All job that have a count is greater than 0 is included in my formula.

I need to consolidate the same for other machines as follow: ....

## VBA Copying Based On Columns Condition

Jan 24, 2014

I have three columns - as listed below. I need a script - That compares "result 1" and result 2. If there are data in the "result 1" column then input that into the "City" column. Else input "result 2" data (if any exist), else leave blank.

"Result 1" always has priority over over "Result 2".

City
result 1
result 2

San Fran
San Fran
New York
Tampa

## Populate One Column Based On Condition Of Two Other Columns

Jan 17, 2014

15.png
Attached is the file & snap shot for the problem.

TABLE A
[table="width: 500, class: grid"]
[tr]
[td]Catagories state names devices
A4-100HP A ALT

[Code] .....

TABLE B
Catagoriesstate names devices
A4-100HP
A4-101MP
A4-102AP

[Code] ....

In above condition we want to have an automatic filling up of data in table B in column (name & device) but it should match first with state name with category codes of table B & then same with table A in order to avoid any wrong entry because in table A certain states are repeated but codes are unique so we want that filter should match two column of each table before filling data in table B.

## Delete Columns From All Sheets Based On Condition In X Workbooks

Mar 28, 2008

I am sure this is a very simple questions. I am using the below code to work on the worksheets on a workbook called "MF BANK EXPOSURE SUMMARY.xls" so far the code that I am using is:

Sub Commandbutton2()
Dim iCol As Long
Dim Isheet As Long
Dim Item As Worksheet
Set MFBANK = Workbooks("MF BANK EXPOSURE SUMMARY.xls")
For Each Item In MFBANK.Worksheets
With Item. Range("A1:T65536")
For iCol = .Column + .Columns.Count - 1 To 1 Step -1
If IsEmpty(.Cells(65536, iCol)) And IsEmpty(.Cells(1, iCol)) Then
If .Cells(65536, iCol).End(xlUp).Row = 1 Then .Columns(iCol).Delete
End If

Next iCol
End With
Next Item

End Sub

I would like to extend the code so that it works on the worksheets of two workbooks at the same time the one being the "MF BANK EXPOSURE SUMMARY.xls" and the other being "MF CP EXPOSURE SUMMARY.xls" .

## Macro To Segregate One Column List Into Three Columns Based On Condition

Nov 21, 2012

Lets say we have data in Column A, B, C and D and no row left blank. In the column A no cell left blank however in B, C, D any one cell only contain a value in that row. If B10 has any value in it then C10 and D10 are left blank (not empty). I want to segregate the data in Column A based on the value in B, C or D. So this one column data ( that is Column A) will split into three column. this segregated data to be put in E, F and G.

Wherever Column B has any value that's greater than zero content from the column A from the same row should copy to the E, Wherever Column C has any value that's greater than zero content from the column A from the same row should copy to the F, Wherever Column C has any value that's greater than zero content from the column A from the same row should copy to the G.

## Dynamic Columns - Filter Based On Criteria?

Feb 19, 2013

I have a 6000+ row database with 5 columns across. The 5 columns have the following headings: Hair Color, Eye Color, Age, Location, and Salary.

I have created macros that will filter each column based on criteria - for example:

[Code].....

As you can see, at cell J10 and K10, I list the filter that is used for a particular search. Some searches, will only have 2 search criteria, some may have all 5, etc.

On a separate worksheet (in the workbook), I have a "Report Tab", my question (after a long build up) is how do I dynamically change the columns and values on the "Report" tab depending on the search that I perform? For example, if I did a two variable filter (Hair and Salary), those would be the only two columns on the report - if I did all five variables for the search, all columns would be on the report, and so on.

## Count SUM Occurrences By Month

Nov 3, 2006

I've set up a trial sample register to monitor progress.

Column A contains date of receipt
Column B contains data of report
Column D contains a formula to indicate whether the deadline was achieved, or force the cell to be blank if no date was entered,
=IF(C2="","",IF(C2>=B2,"Yes","No"))

Columns E to P contain other information.

So far ok.

I want to create a summary by month., giving the number of samples received each month, which I did by extracting the month from column A =month(A2), but i also want the number which met the deadline.

How do I count the number of Yes for each month?

## Count Number Of Occurrences

Dec 27, 2006

I have a somewhat large spreadsheet that is imported from an AS/400 database which shows the number of times something is being used. It lists the object in a row for each use. For instance, if the object is being used 4 times, there would be four rows of this object's name as well as a 0, 1, 2, 3 next to the correct row. Where it is being used is listed in the H Column.

I'm just trying to count the number of times each object is used and where it is used and list it out in another worksheet. Like this:

Object 1, 4 uses, Place 1 2 3 and 4.

Can someone point me in the right direction in terms of where to start with this? I don't mind giving it a shot in terms of the coding but I'm somewhat at a loss in terms of the general "how to".

## Count Most Occurrences Of Value In Range

Apr 10, 2008

I have a table of values, each of which can occur multiple times on multiple rows. I need to figure out the maximum number of times a specific value appears in a row. I could do it quite easily with VBA, running countif on each row and tracking the maximum, but I would like to do it with builtin formulae if at all possibl

## Count Occurrences Of Names

May 9, 2008

I have a small sample sheet attached..I need a formula in column c which identifies how often the name in column B hass occurred already in the sheet. Auto Merged Post Until 24 Hrs Passes;File attached

## Count Occurrences Using Multiple Criteria

Feb 25, 2014

Iam doing a market report for real estate. I have attached a file for reference. I am trying to track the Active Listings within a given time period and within a specific zip code. Unfortunately my local MLS does not track historical data on Active Listings, and therefore I have to use the Listing Date and the date it no longer went active to determine which listings were active in a given time period. Some of the listings are still active and therefore do not have a "No Longer Active" date. These listings will need to be counted as well.

MLS Active by Zip.xlsx

## Count Number Of Occurrences In Excel

Apr 22, 2014

In a datafile I have one column containing a trip 'origin' and a second column contains 'destinations'. I want to count how many times each trip occurs (so the same origin/destination pair). This is doable using COUNTIFS but unfortunately respondents did not provide consequent origins and destinations. I encountered the following formulations

-Alfastraat, Amsterdam
-Alfastraat 5, Amsterdam
-Alfastraat 5, 1021AB Amsterdam
-Amsterdam, Alfastraat

Since the format is different among and within respondents functions containing LEFT, RIGHT, MID are not useful (at least, my trials did fail). I found a VBA-script for a FUZZYVLOOKUP which sounded promising. Unfortunately the data is stored on a remote PC without VBA on it.

Is there a way to count the occurrences of trips given the circumstances?

## Count The Number Of Consecutive Occurrences

Nov 18, 2008

I have an excel spreadsheet to record employee holiday and sickness figures.

It is set on as a grid e.g. column A stores all the dates and then employee names are used as column header.

One of the triggers I need to use is where, an employee has been absent 28 consecutive days. When an employee is absent I simply enter 'ABSENT' against there name.

Countif will count the number of time absent appears in the column however I need it to only recognise it if it is only 28 days in a row.

## Count Occurrences In Date Range?

Jan 20, 2012

Col A contains a list of random dates going back 1 year in this format 12-Oct-11. These dates are the dates of events. The events are coded into 5 areas in col B with a,b,c,d & e representing each typy of event.

I would like to look at the last 3 months of data taken from Col A and count how many events occured in that time period.

## Sequential Count Number Of Occurrences

Apr 13, 2013

I have a list of numbers in column A- for example

4
3
5
4
3
4

What I want is in column B to give the sequential count that each number is for that number. In other words in row one the number 4 appears for the first time and so the sequence number is 1. It next appears in row 4, so the sequence number there is 2, and for row 6, it is 3.

The completed table will look like this:

A B
4 1
3 1
5 1
4 2
3 2
4 3

Any formula for the cells in column B? My actual list is about 5,000 lines and so I need a formula that is not slow.