I need to find the duplicates in this way.please help me
--|-----|-------|-------|-------|-------
| A | B | C | D | E |
--|-----|-------|-------|-------|------|
1 | 1 | a1 | 1 | | |
2 | 2 | a2 | 1 | | |
3 | 3 | a3 | 1 | | |
4 | 4 | a5 | 1 | | |
5 | 5 | a1 | 2 | | |
6 | 6 | a2 | 2 | | |
7 | 7 | a1 | 3 | | |
8 | 8 | a3 | 2 | | |
9 | 9 | a1 | 4 | | |
10| 10 | a1 | 5 | | |
----------------------------------------
For ex: Individual duplicate B column- In B column "a1" - 5 duplicate values totally,
check the c column i need the output like that
You should be using this formula in Column C
=COUNTIF($B$1:$B1,B1)
Let me know if it does not work.
You want a cumulative sum of the number of occurences of the value in column B. You can do that by inserting the following formula in C2:
=COUNTIF("$A$2:A2; A2)
You then drag in vertically, as far as you like. The result should be something like this:
| "C"
2 | =COUNTIF("$A$2:A2; A2)
3 | =COUNTIF("$A$2:A3; A3)
4 | =COUNTIF("$A$2:A4; A4)
And so on, and so on...
In column C kindly enter below formula.
=COUNTIF($C$1:C1,C1)
And drag it to last cell c10
Regards
Lalit.M
Related
I have an Excel/Google Sheets table in which some rows contain blank cells in between non-blank cells. I would like to count from left to right. I have used the formula COUNTA(A2:F2) but it cannot achieve what I want. This is a sample of the outcome I would like to get, with the Personalized count that I am seeking to achieve and the classic COUNTA:
I think that the task is slightly different from what you describe in the question, you want to count until blank and not between not blank cells.
So I made this working example
+---+------+------+------+------+------+------+-------+
| | A | B | C | D | E | F | G |
+---+------+------+------+------+------+------+-------+
| 1 | 2021 | 2020 | 2019 | 2018 | 2017 | 2016 | Count |
| 2 | 1 | 1 | 1 | 1 | 1 | 1 | 6 |
| 3 | 1 | 1 | 1 | 1 | | | 4 |
| 4 | 1 | | 1 | 1 | 1 | 1 | 1 |
| 5 | 1 | 1 | 1 | | | 1 | 3 |
+---+------+------+------+------+------+------+-------+
where cell G2 contains the following:
=IFERROR(MATCH(1;--(A2:F2="");0)-1;COUNTA(A2:F2))
is it right for you?
This must be a simple thing to do but somehow I am unable to find answer to this question. In google sheets, if you want to reference an entire column (e.g Column A) you will put ={A:A} and the entire column will be referenced. How do you achieve similar thing in MS excel?
EDIT: (Asked in comments to post specific example)
Lets assume google sheets contain the following data:
| A | B | C |
| 1 | 5 | 9 |
| 2 | 6 | 0 |
| 3 | 7 | 9 |
| 4 | 8 | 0 |
Now if in cell D1 I type ={A:A}, the entire column A will be shown in column D.
| A | B | C | D |
| 1 | 5 | 9 |={A:A}
| 2 | 6 | 0 |
| 3 | 7 | 9 |
| 4 | 8 | 0 |
becomes
| A | B | C | D |
| 1 | 5 | 9 | 1 |
| 2 | 6 | 0 | 2 |
| 3 | 7 | 9 | 3 |
| 4 | 8 | 0 | 4 |
I dont have to drag the formula to the bottom or anything. It just shows the entire column
How do I do the exact same thing in excel?
It depends. For example:
=COUNTIF(A:A,"gold")
Excel does not support stuff like:
=COUNTIF(A12:A,"gold")
Summary
I want to have a column in my spreadsheet that does 2 things.
1) In an ordered column, it will return the range where the column contains a specified value.
2) It will run a function (i.e., =SUM(), =AVERAGE(), etc.) over that same range in a different column.
Examples
Original
| NAME | VAL | FOO |
|-------|-----|-----|
| A | 3 | |
| A | 2 | |
| A | 4 | |
| A | 3 | |
| B | 2 | |
| B | 2 | |
| B | 1 | |
| C | 6 | |
| C | 5 | |
Average
I would want to get the average of VAL for each NAME. I would want the result to be:
| NAME | VAL | FOO |
|-------|-----|-----|
| A | 3 | 3 |
| A | 2 | 3 |
| A | 4 | 3 |
| A | 3 | 3 |
| B | 2 | 1.7 |
| B | 2 | 1.7 |
| B | 1 | 1.7 |
| C | 6 | 5.5 |
| C | 5 | 5.5 |
Sum
Another example would be to get the sum of VAL for each NAME.
| NAME | VAL | FOO |
|-------|-----|-----|
| A | 3 | 12 |
| A | 2 | 12 |
| A | 4 | 12 |
| A | 3 | 12 |
| B | 2 | 5 |
| B | 2 | 5 |
| B | 1 | 5 |
| C | 6 | 11 |
| C | 5 | 11 |
Having "NAME" ordered makes it easy. If "NAME" is in A1. Enter this into C2 for the sum, then fill down:
=IF(A2=A3,C3,SUMIF($A$2:A2,A2,$B$2:B2))
Enter this into C2 for the average, then fill down:
=IF(A2=A3,C3,AVERAGEIF($A$2:A2,A2,$B$2:B2))
Note that the result in C2 won't be what you want until you fill down.
Update for MAXIF
If you don't have Excel 2016, you'll have to use an array formula (commit with ctrl+shift+enter):
=IF(A2=A3,C3,MAX(IF($A$2:A2=A2,$B$2:B2)))
I have this Excel sheet in which I have many columns, and I need a sum formula applied to every one of them:
| | A | B | C | D | E |
| 1 | Products | Prod1 | Prod2 | Prod3 | Revenues |
| 2 | Price/u | 10 | 20 | 30 | -------- |
| 3 |Price Fixed| 5 | 10 | 2 | -------- |
| 4 |Sales | ----- | ----- | ----- | -------- |
| 5 | 2017 | 1 | 5 | 56 | ?????? |
| 6 | 2018 | 3 | 10 | 100 | ?????? |
| 7 | -------------------------------------------- |
| 8 | TOTAL | SUM() | SUM() | SUM() | -------- |
I was wondering how to calculate ?????. Indeed, it would look like:
=(B5 * B2 + B3) + (C5 * C2 + C3) + (D5 * D2 + D3), the problem is that I need to get that to Z.
Thanks!
You can use this formula:
=SUMPRODUCT(B5:Z5*B2:Z2 + B3:Z3)
SUMPRODUCT operates on arrays. It is here submitted a single array, so it just sums it up. This array is computed as:
element-wise product of the row vectors B5:Z5*B2:Z2
element-wise addition of row vector B3:Z3
You can also use an array formula and then sum the lot:
={SUM(B5:Z5*B2:Z2+B3:Z3)} not forgetting to do array formulae you use CTRL+SHIFT+ENTER
In my spreadsheet, I am trying to highlight duplicate values in a row.
Catch #1 is, every row is assessed differently.
Catch #2 is, the values are not adjacent in their rows.
Example:
A | B | C | D | E | F | G | H | I |
1 Bob | 1 | Jim | 2 | Pat | 3 | Sam | 4 | |
2 Bob | 3 | Pat | 1 | Sam | 1 | Jim | 2 | |
3 Jim | 2 | Bob | 2 | Pat | 3 | Sam | 2 | |
4 Pat | 3 | Pat | 3 | | | | | |
5 | | | | | | | | |
In the example, I am checking each row for duplicates in columns B, D, F and H. Basically the number columns are being assessed against each other.
Row 1: None are highlighted.
Row 2: D2 and F2 are highlighted
Row 3: B3, D3, H3 are highlighted
Row 4: B4 and D4 are highlighted, but F4 and H4 are not because they're empty. A4 and C4 aren't highlighted either because columns A, C, E and G aren't being checked.
Try this formula in conditional formatting's formula based rule:
=AND(ISNUMBER(A1), COUNTIF(1:1,A1)>1)
Hope this helps!