tags:

views:

30

answers:

2

Hey, I have an excel document with columns A and B. Row A has 2595 values. Row B has 411 values.

I'm trying to figure out how I can compare these two columns by marking column C with the number of times we find a value(s) from row a.

For Example

COLUMN A           COLUMN B        COLUMN C
1                  1               1 (because we have one value of 1 from column A)
2                  2               1 (because we have one value of 2 from column A) 
3                  3               2 (because we have 2 threes from column A) 
3                  4 
4                  5
5                  6               2 (because there are two 6's in column A) 
6                  7               0 (because there are no 7's in column A)
6

I'm sure you can see where I'm going with this but for the life of me I cannot figure out how to do this, I've been searching around all morning. Help!

If needed I can supply the excel document.

A: 

You can use COUNTIF. If A1:A8 is your search criteria, B1 is the value you're currently processing, C1 would be:

=COUNTIF(A1:A8;B1)
steinar
A: 

You can use the COUNTIF function

Column A    Column B    Column C                Answer
1          1            =COUNTIF($A$2:$A$9,B2) [1]
2          2            =COUNTIF($A$2:$A$9,B3) [1]
3          3            =COUNTIF($A$2:$A$9,B4) [2]
3          5            =COUNTIF($A$2:$A$9,B5) [1]
4          6            =COUNTIF($A$2:$A$9,B6) [2]
5          7            =COUNTIF($A$2:$A$9,B7) [0]
6           
6
Ahmad
How could I adapt this for column A having 2595 values and column B having 411. Sorry, im doing this as a favor at work and I don't really get the syntax. thanks for your help so far! Edit: I figured out how to select all 2595 cells for row A but it looks like I would still have to insert numbers for B1-411 by hand? Is there an easier way?
Jordan
Edit again: it looks like excel does that part automatically so this is the formula I used. =COUNTIF($A$2:$A$2595,B2) and then excel changes the column B values for the cell its currently in. THANK YOU!!!!
Jordan
@jordan - what you are seeing is excel's autoincrement feature thingy..glad it worked
Ahmad