# Excel 2010 :: Count Distinct Text Values In One Column If Another Column Equals A Value

Mar 5, 2014

I am trying to count the distinct times a value shows up in a column, if another column has a 2 in it.

For example:
Columns
A, B
2,P25
2,P25
3,P5
3,P6
2,P5

The results shoud be: (2) Because I only want to count the P25 one time.

I'm using Excel 2010

## How To Count Distinct Values In A Column

Jan 21, 2014

I have a spreadsheet which contains (see illustration below):

1. a column called LEAD ID which contains a unique id
2. a column called WON which signifies if the deal was won/not won (1 = WON, blank = Not Won)

I can have multiples of the same value in the Won and Unique Id field (see illustration below)

I would like to create a formula field which returns the summary of the No. of Deals WON

I need to tie the formula back to the Lead ID and whether or not the WON field contains 1 or not.

I've tried this formula but it won't work
(Lead ID is in Column A, WON is in column B)

=IFERROR(SUM(1/COUNTIF((A:A,A:A) AND(B2=1)),"0")

LEAD ID WON No. Won (Formula field)
abc112 0
abc222 1 .25
abc222 1 .25
abc222 1 .25
abc222 1 .25
abc333 1 1
abc444 0

## Count If Column A Contains Defined Text And Column B Equals Defined Word

Mar 25, 2014

formula that would count the instances in Column C, where Column A contains "LH" or "RH" as part of the word, and column B equals "Either".

## Count Unique Occurrences In Column A If Column B Equals Value?

Jul 25, 2014

how to count the unique occurrences in column A based on the value in column B. In the example below, I am trying to count the number of unique names in each state (Illinois=1, Colorado=2, New York=2). I would like the formula to count unique occurrences for the entire column A because I will be adding to the list.

..A.............B............C
John......Illinois
John.....Illinois
Alex.....New York
Steve...New York
Steve...New York

## Summing Up Values In Column Corresponding To Unique Distinct Values In Another Column?

Dec 24, 2013

I have two columns in excel, col A and col B.What I would want to achieve is following:

Col A Col B
A 2
A 2
A 2
B 3
B 3
B 3
B 3
C 3
C 3
C 3

Now I want a total of values in column B pertaining to unique (or say 1st occurences) of values in Col A. So in this case the output should be 8 ,Achieved as follows(2 +3+3).

[URL]

## Sumproduct (count The Number Of Unique, Or Distinct, Company Names In Column)

Jan 28, 2010

I want to count the number of unique, or distinct, company names in column [C7], subject to two conditions that will exclude certain unique company names from the count.

I should also point out that most company names appear multiple times in column [C7].

a) Count the unique company names in column [C7]...

b) ...including only those companies who have at least one "Yes" in column [C8] somewhere among their records

c) ...and who also have at least one value equal or greater than "1" in column [C15] somewhere among their records

Note that that there is no requirement that the "Yes" and the "1" ever appear in the same record.

## SUBTOTAL IF Formula To Sum Distinct Values In A Column

Jan 2, 2010

I'm looking for a SUBTOTAl IF function (if there's any) that would sum all the distinct values in a column for a given criteria based on another column. My data is listed below:

Column A Column B
(Quarter) (Revenue)

Q1 2008 \$10
Q1 2008 \$10
Q1 2008 \$20
Q2 2008 \$15
Q3 2008 \$25
Q3 2008 \$25

I'm looking for a formula to sum the DISTINCT Revenue values for Q1 2008, Q2 2008, and Q3 2008 based on the autofiltered list. The formula result should change dynamically based on the autofilter selection.

## Create Helper Column That Marks Distinct Values

Nov 26, 2012

I have a table with 200.000 rows.

I need to create a helper column, that marks distinct values with 1 and not distinct "" or 0.

I tried the following but both use countif and I believe it is the problem it's just to slow.

=IF(COUNTIF(\$A\$2:A2;A2);1;0)
=1/COUNTIF(\$A\$2:A2;A2)

but both are really slow +20 mins to calculate and many times Excel crashes( 2007 32bit).

The workbook is really simple

Col1 (number formatted as text) - Col2 =distinct

## Excel 2010 :: Search For Value And Then Give Count Of Corresponding Value In Different Column

Mar 12, 2013

I am using Excel 2010 and am looking for a formula that can solve this matix in column below. The yellow is where I would like the answers.

A
B
C
D
E

1
DEP
SPS
SUB

2
123456

[Code] ........

This is what it would look like when the formula were applied

A
B
C
D
E

1
DEP
SPS
SUB

2
123456

[Code] .........

## Auto-populate Combobox - Extracts Unique Distinct Values From Column

Jan 11, 2013

The code below extracts unique distinct values from column A, except cell A1. Then the code adds the extracted unique distinct values to the combo box.

Sub FilterUniqueData()
Dim Lrow As Long, test As New Collection
Dim Value As Variant, temp() As Variant
ReDim temp(0)
On Error Resume Next
With Worksheets("Sheet1")

[Code]....

The vba code below copies the selected value to cell C5 whenever the combobox is selected

Copy the code into a standard module.Assign this macro to the combobox

Sub SelectedValue()
With Worksheets("Sheet1").Shapes("Drop Down 1").ControlFormat Worksheets("Sheet1").Range("C5") = .List(.Value)
End With
End Sub

Vba code belows instanly refresh the combobox when values are added/edited or removed from column A,

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("\$A:\$A")) Is Nothing Then
Call FilterUniqueData
End If
End Sub

My problem is this:

Everything will be working fine if the all combobox and data can be found in 1 sheet, but how could i make some tweaks if the combo box is located in sheet 2 provided your data to be populated is in sheet 1, i tried everything but the combobox doesnt update,

## Excel 2010 :: Condition Formatting On Column Of Text?

Jul 22, 2014

I have a column of numbers that are already formatted as text. Some of the data is duplicate which is fine. It's like a list of 6000 numbers. I want to conditionally format the column so that I can fill the cell with a color as long as it stays the same number, but if it changes to a new number make it a different color. I don't need a lot of colors. Two is fine. TI have Excel 2010.

## Excel 2010 :: Text To Column Runs Automatically?

Dec 15, 2012

I'm using Excel 2010 and have run into the following problem. I have data in a text editor that I need to separate. I copy and paste this data into Cell A1, then do a "Text to Col" function that separates the data correctly. Now I have other data to paste into other cells on the same sheet. Here's the problem....The "Text to Col" function runs automatically when I paste other data into any other cell on the WS. How do I turn this off without closing the WS?

## Excel 2010 :: If Cell Contains Red Text In Column Then Delete Row?

Mar 10, 2014

I'm using Excel 2010). I have column I, which is the sum of columns A and B (first and last names of patrons), and I have used conditional formatting to identify all duplicates in column I with red text. I would now like a macro to find red text in column I and then delete the corresponding rows.

I've been looking around on the web for a while and have cobbled together this code stolen from other people's macros:

[Code] ....

When I run it, I get the following error:

Run-time error '1004':Application-defined or object-defined error

Excel doc is called "stupid mailing list.xlsm", sheet I want to run the macro on is called "voters".

## Excel 2010 :: Automatic Generate List - Row / Column And Values

Jul 8, 2013

How can I create a Makro that looks for values (e.g. values > 90) and that then generates a list with: all the values greater than 90, the row names and column names of the values?

I am pretty sure I will need a Makro for this, but how to create it. I am using excel 2010.

I have attached a file to give you an example. The red table is the table with the values. The blue table is what I want to be generated automatically. In the example I did it manually.

Workbook1.xlsx‎

## Excel 2010 :: How To Find All Unique Values Then Combine In A New Column

Jul 9, 2013

I have a wookbook with serial numbers in column A and barcodes in column B. There are 51940 rows in total.

Is there a way I can search through column A, and for each unique value found , concatenate all of the barcodes that relate to that serial number in column C?

Serial Numbers | Barcodes | Combined Values
-------------------------------------------------------
abc123 abc12300 abc12300,abc12301, etc etc
abc123 abc12301
def456 def45600 def45600, def45601, etc etc
ghi789 def45600

i am using Excel 2010.

## Excel 2010 :: For Selected Date Between Dates Sum Values In Another Column

Jan 26, 2013

We have arrival dates and departure dates for guests and would like to figure out the number of meals needed on a particular date.

Named ranges: NumGuests _ArrivalDate _DepartureDate _CheckInTime _CheckOutTime
Need number of breakfasts
Number of Lunches
Number of Dinners for a given day of the week.

So if a guest is here say Jan 25 arriving after 9am, staying 2 nights they will have Lunch and Dinner on the 25th, BLD on the 26th and BL on the 27th. Since by default most arrive after 9 (miss breakfast), we can eliminate the checkin time for the breakfast calc and make the first one for the next day.

There might be other guests staying through that time period. The ******* would like to know how many meals they will need to prepare for the week.

Windows XP, Excel 2010

## Excel 2010 :: VBA Macro To Split Text In Every Cell Of The Same Column?

Apr 16, 2014

Excel VBA 2010.

I have this problem:
e.g Cells ""
C2 - 128.50 g
C3 - 211.01 g
C4 - 198.50 g
C5 - 179.34 g

I need to split the text into
Cell "C2" = 128.50 and Cell "D2" = g
Cell "C3" = 211.01 and Cell "D2" = g
and so forth

I wanted to avoid using delimited method with space and induce an automated method to format every cell of Column "C" one by one.

## Count Values Of Column If Column Header Is Equal To Name In Column A?

Apr 25, 2014

For column "B" count all the 1's if column header is equal to name in column A.

For Column "C" needs to be checked if a value was filled in column "I" if yes then check if in column "L" has a value, count all these values.

## Excel 2007 :: Delete Column If Cell Equals To Zero

Aug 6, 2012

HTML Code:
Sub DeleteEmptyColumns2()
Dim Cell As Range
For Each Cell In Range("4:4")
If Cell = "0" Then
Cell.EntireColumn.Delete
End If
Next Cell
End Sub

I am attempting to remove columns in my table of data, using the above code seems to remove some them but not all, is this the best way to loop through a range?

## Formula: Count Distinct Values

Dec 23, 2006

I have this formula that works perfectly in Excel. It counts the unique TEXT values in a column. But it does not work in the VBA editor. Count = SUMPRODUCT((C6:C39<>"")/COUNTIF(C6:C39,C6:C39&""))

## Excel 2010 :: Unmerge Cells And Fill Down Values In Newly Inserted Column

Jul 9, 2014

I am using Excel 2010 and have the problem as shown in the attached file.

Input Sheet shows the Data I have at present
Output Sheet is the desired result.

I need a macro which should create an "Output" sheet by doing the following on the Input Sheet

1)Insert a Blank Column before Column A
2)Unmerge the Region Heading and insert the respective Region Name in the newly inserted Column. Region Heading will be in Bold Font.
3)Repeat Step 2 for all Regions
4)Delete the Rows which was merged.

Please note that the number of Data Rows will vary for each Region.

I have shown two Regions for explanation purpose only. There will be several Regions in reality.

The result is shown on the Output sheet

Merge Problem - Forum.xlsx‎

## Excel 2010 :: INDEX MATCH Only Returns First Value Instead Of All Matching Values In Selected Column

Jul 18, 2014

Excel 2010: I'm working with a sheet where I would like to get accurate results on the make and model of cars sold in a given week. The workbook contains several worksheets each representing weekly sales numbers for different vehicles.

The Make-Models tab has the lists used to create the drop-down selections.

The Sales tab allows one to create an ad hoc report on the total number of vehicles sold, by Make and Model. Cell B2 is named 'SelectedModel' and used in the formula found in column E, Total Sold.

Problem: When I select Honda, for example in B2 of the Sales worksheet then select Accord in cell B3 of the same. The results returned in E2, E3 and E4 are 2, 3 and 4, respectively, instead of 8, 3 and 7.

2 Honda Accords were sold on Monday and 6 on Tuesday of the same week. My formula is only returning the first matched value of 2 whereas I would like it to return 2+6, 8 for week 1. Same goes for other weeks.

Select any other make and model and notice the problem follows. I believe the error is due to incorrect usage of the formula or incorrect formula altogether.

IF(ISNA(INDEX(Week1!E:E,MATCH(SelectedModel,Week1!B:B,0))),0,
INDEX(Week1!E:E,MATCH(SelectedModel,Week1!B:B,0)))

## Excel 2010 :: VBA Code For Inserting Text In All Column B-cells Of Multiple Selected Rows

Jul 11, 2012

Software: Excel 2010, Windows 7

What is the VBA code for inserting text in all column B-cells of multiple selected rows?

I am creating a worksheet with a table containing various data related to orders of various materials (this is more or less data gathering from an older, paper-based 'system'). This table spans, columnwise, from A to D and expands downwards as more orders are added. The information in each column is: A=order number, B=type of material and C=material specs. and D=additional comments.

I've set it up so that the only thing I really have to do is to insert the type of material in the cells of column B, and the rest will sort itself out. Instead of having to insert a new row for each new entry and manually typing in the name of the material (these entries are often done in the midst of already existing data), I created several similar, macroed buttons for the different types of materials we use. These macros work by selecting the row of the currently active cell, inserting a new row and then add the name of the material in the column B-cell of this new row. What I am having trouble doing though, is to get the text-entry to work for a selection of multiple cells.

As an example, lets say that I would like to add 5 orders of "Grade A Steel" in the middle of the table - in the row above row 8. With the macro I currently have I can select cell B5, click the macro, and a new row will be inserted with "Grade A Steel" in column B of this new row. This action could be performed 5 times over, but would be easier if I could just mark a range of 5 cells, say B8:B12, click the macro and get the text/data inserted the column B-cells of all 5 of the new rows. So far I've been able to create a macro that inserts multiple new rows, but I've only been successful in filling the column B-cell in the first row leaving the 4 below empty.

## Excel 2010 :: Formula To Determine If Duplicate Values Exist In Single Column (excluding Empty Cells)

Jun 29, 2012

1 workbook, 2 worksheets (or tabs). On tab 1, I want a formula/alert that tells the user if any duplicate values exist in Column A of tab 2

Tab 2, Column A, has Unique ID's (6 digit numeric values)

The user manually inputs the ID's on new rows in Column A

Row 1 is reserved and in use for something else
Row 2 is my header, so cell A2 says "ID"
Row 3-623 currently contain unique ID's

When the user inputs a new ID into cell A624, then they return to Tab 1, I want my formula/alert on Tab 1 to tell the user that they have duplicates in Column A of tab 2. I know the Conditional Formatting, but if the user copies in 100 new values, they won't necessarily see the highlighted cells. My tab 1 is my "checks and balances" and the last place the user is suppposed to look to ensure that they haven't created any duplicate ID's. If the user sees a warning message that says duplicates exist, then I'll tell them that they need to look at column A (for cells that have been conditionally highlighted).

One issue that I'm running into with the conditional highlighting is that I want cells A3:A1048576 to already have the conditional formatting - this way when the user inserts a value into Cell A624, then A625, etc they conditional formatting is already there. Right now with data in cells A3:A623, cells A624:A1048576 are all highlighted with the Red/Bold Red Font (which is okay I guess), but ideally it would be nice to not count 2+ empty cells as duplicates and I'll have to have my formula on Tab 1 not include the blank cells.

I DO NOT want to use the Remove Duplicates feature of Excel 2010. If I remove them I could be removing data in columns B, C, D, etc that belong to the Unique ID. I just need the user to be told in Tab 1 that they DO have duplicates and I'll train the user how to research this and fix it.

The reason I want to look for duplicates in the entire Column A is because the list of Unique ID's will grow over time.

## Count Unique Frequencies Column A For Pacific Values Column B

Dec 19, 2010

I would need to count unique frequencies in column A, but only for a specified value in column B.

Example:

A|B
1|1
1|1
1|1
2|1
2|1
2|2
2|2
3|2
3|2

I am using Excel 2007 and found this formula that counts all unique frequencies in column A: =SUM(IF(FREQUENCY(A2:A10,A2:A10)>0,1))

In my example, result = 3 Now, I would need to add the possibility to count only for B=1; in my example, result should be = 2.

## Perform Count On Column B Based On Values In Column A

May 15, 2014

I have a column that repeats it self and I want to perform a count on Column B, based on the values in Column A.

Example attached : Book2.xlsx‎

## Count Unique Values In One Column If Other Column Matches?

Oct 18, 2011

How do I count unique values in Column A only if the values in Column B match?

A B
1 a
2 a
1 a
4 b
5 b
1 b

The formula would return "2" for "a", and "3" for b. Basically, there are names in column B, and I want to know how many unique things are in column A for each person. If there is a better way than a formula (pivot table?) that would be great - like a table that has each of the names (from Column B) and the number of unique items from Column A next to each unique name.

## Count Column Based On Certain Text In One Column And Blank In Another

Feb 4, 2014

I need to count column E when it does not say "MTO" or if column G is blank. E.g. below would return me a value of 2. I would count row 1 and 3 only.

Column E Column G
10-Jan-14
MTO
06-Dec-13
18-Oct-1321-Oct-13

## Excel 2010 :: Calculating Sum Of Column By Column

Jul 2, 2014

I am making an order for my shop and I want to multiply product price X (Column #1) with quantity Y (Column #2) and sum it.

I have a picture attached : uznSuuc.png

I want it to be A2*B2+A3*B3+A4*B4+A5*B5+A6*B6+A7*B7=Z (Total)

BTW My office version is 2010.

## Excel 2003 :: Count Column A When Y Appears Only When Column B Has X?

May 14, 2013

I need to populate sheet 1 of the spreadsheet attached.

I have tried several formula's but don't work and am getting desperate!

I need to count Column A of sheet2, when "Adverse SEN" occurs but only when there is an "x" in Column B of sheet 2 appears next to "Adverse SEN".

So basically i need to populate Sheet1 of the spreadsheet with the data is sheet2 of the spreadsheet.

I need a formula to calculate how many time an adverse SEN was - where there is an x - resubmitted, approved at meeting, delegate approval obtained, approval outstanding, rejected or approval not required.

I am using excel 2003, so please don't provide me countif functions.