let's say I have a list of duplicate values in a column such as:AAABBAACABC. ...AAC. Then I want Excel to Rank respectively the first A as A1,the first B as B1 the second A as A2 and the second B as B2 and so forth until the A(nth) and the B(nth). And any additional A should automatically Rank as A(nth+1). Same thing for B C etc.
note that I should be able to enter any new value such as X that will automatically Rank as X(nth+1) or X1 if it did not exist in the table before.
Hoping that I made myself understood. I am waiting for anyone to help me. VBA or array formulas I have no preference once I can realise what I want.
Note that I found a way by sorting them in accending order but it can't match for any additional value at the end of the data base.
Thanks.
I am assuming your data is in Column "A". Enter the formula in Column "B" and copy the formula till the row you want.
=A1 & IF(A1="","",COUNTIF($A$1:A1,A1))
Related
Hi I have a bunch of data and I need to know how much of each value show up and how often the frequency is only corresponding to the unique value. I used a countif to count the unique value but I wanna know the frequency of the amount of times it shows up.
Sorry if this doesnt make any sense here's a screenshot to maybe help you understand better.
https://imgur.com/a/hLUY5um
Change the formula in B1 to,
=IF(COUNTIF(A$1:A1, A1)=1, COUNTIF(A:A, A1), TEXT(,))
and fill down to match the values in column A.
Copy column B into column E then Sort and Remove Duplicates¹.
This simplifies the formula in F1 to,
=COUNTIF(B:B, E1)
Fill down to match the values in column E.
¹ The Custom Number Format for column E is F\r\eq 0_).
I am trying to create a formula which compares numerical values of two columns and when a match is found return data from a different column.
Here is the problem I am having - the formula I have come up with seems to go Row by Row - for example, if column A & B are the two columns I want to compare, with column C having the data I want if a match is made. If I have a value of 1 in row A1 and a value of 1 in B1 - it will successfuly return the data in column C.
The problem is that my numbers are jumping, the row's do not match, for example column A is 1,2,3 however column B is 1,3,2. The end result here is that I get data for the value 1, but on the mismatch for the second row I get no value.
Basically the formula I made seems to do a hard comparison based just off the two rows of each column - meaning it will only compare A1 to B1. What I really need is it to compare the ENTIRE column and disregard the rows completely
Here is the formula I have been fooling around with - this formula works if A1 and B1 match
=INDEX(M:M,MATCH($L:L,$V:V,0))
In this formula M has the data I need, while columns L and V have numerical values, I need it to not 'hard check' row by row and instead evaluate the entire column and when a match is found return the result (so if both columns have a '2' return that value REGARDLESS of the fact that the '2' may be in rows A2 and B9)
Hopefully I explained my issue well, and I appreciate all the help I can get
EDIT
Sorry for failing to explain it properly on my end -- I will base my explanation off the picture link below.
I need data from column B to show up in column D. What is happening is row 2 matches so the data is successfully retrieved for number 1 - however on row 3 where column A switches the numbering it compared the number '3' to the number '2' and recognizes it is not a match and returns NA -- even though there IS a match in columns A4 and C2 -- in this situation for C3 I would need the data from B4 to showup in D3
http://i.stack.imgur.com/nrKJp.png
Two formulas that will each give you the return you want, Put one of the following in D2 and copy down:
=VLOOKUP(C2,A:B,2,FALSE)
OR
=INDEX(B:B,MATCH(C2,A:A,0))
In Excel I have a problem...I don't know many formulas/rules.
This is my case:
Scenario 1)
A B C
1.| Drw....3350......03
2.| Drw....3350......02
This is my desire:
I want to hide row 2.
Scenario 2)
A B C
1.| Drw....3350........03
2.| Img.....3350........02
This is my desire:
I want to keep both rows.
My problem in words:
Scenario 1: Because A1 & A2 + B1 & B2 are the same, I want to hide the row with the smallest number in column C.
Scenario 2: Because A1 & A2 are different I want to keep both rows, even though B1 & B2 are the same.
This is a simplified example. Column A could consist of hundreds of rows with mixed values. However, Column A is text and column B and C are values.
There will not be such a case when C1 & C2 are the same. (only if someone typed in wrong)
What I am asking:
I don't know what formulas or rules to use in Excel and would prefer to not use VBA for this. Seems like such a simple task but I just don't know how to.
Anyone?
In your Title you mention and B1>B2 and then give two examples in both of which the 'B' values are the same, so assuming you mean to hide the lower C value where the A values match and the B values match then in a helper column, say E:
=A2&B2
and in another column (I chose H):
=AND(MIN(IF(E7=E:E,C:C))=C7,MAX(IF(E7=E:E,C:C))<>C7)
entered with Ctrl+Shift+Enter and copied down to suit. Then filter that column to select for FALSE:
I have 2 sets of data. I put it in Excel e.g. column A and column B. Now I want to know which data from B is part of column A. I run this formula =IF(COUNTIF($A$1:$A$327238,B1)>0,"Exist", "Nope")
Then I 'filter it and look only 'Exist'. Based on that I know that all data in B that has label 'Exist' is part of column A
Now I want to know opposite i.e. which data from A are part of B. For that reason I use the same formula but I replace the data in columns i.e. data from B now in A and vice versa.
Then I randomly verify results.
For case 1 it looks it works fine but for second case it looks it's not accurate.
My assumption: should it work in case 2 as well ( maybe I just was not very accurate in some way ) and I should expect it to work?
Thanks
In cell C1 (assuming your data starts from 1st row) type the following =IF(A2=B2,"equal","no"), and then populate the same formula to the last row where there is still data, so that for row N, your formula in column C is =IF(AN=BN,"equal","no"). After that you will just need to count the cells with value "no" to know the differences. Sorry if I didn't get the question correctly.
Ok, assuming that the two sets of data are in columns A and B (they might be of different sizes), and the last rows of data are L and M respectively, click on D1 and type the following: =IFNA(INDEX(B$1:B$5,MATCH(A1,B$1:B$5,0),1),"Unique"). Drag down to apply this formula on D1 - DL. That's it, you have the duplicate elements. Since the duplicate elements are the same in both columns - A and B, you don't need to repeat this for column B. Note, that for all the unique elements the corresponding rows of column D have the word "Unique", so if you want the unique elements, you can just get the elements from A with the mentioned row numbers:
Just select any column's first row cell and type the following formula: =IF(D1="Unique",INDEX(A$1:A$L,ROW(D1)),"Duplicate").
I've read elsewhere on Stack Overflow that Excel questions are acceptable here, so please don't get annoyed :) If they should be elsewhere, just let me know...
I'm frustrated, because I'm pretty sure I used to know how to do this.
Imagine the following table:
Frequency Object
3 A
2 B
4 C
In a third column, I want Excel to write:
A
A
A
B
B
C
C
C
C
(3 A's because frequency of A = 3)
I'm pretty sure that this can be done by a single formula copied down the third column, but I can't remember how. Any suggestions?
I liked the elegance of (1) formula, but it will only work if you dont have repeated objects (data).
This will always work, as long you dont have a numeric, diferent from zero, value in E2
Freq values in E3:E6 and Obj in D3:D6, formula starting in P3
=LOOKUP(ROWS(P$3:P3)-1;SUMIF(INDIRECT("E2:E"&ROW($E$2:$E$6));">0");$D$3:$D$6)
or (and, in this case, you can have anything in E2)
=INDEX($D$3:$D$6;IF(ROWS(L$3:L3)<=$E$3;1;1+MATCH(ROWS(L$3:L3)-1;SUMIF(INDIRECT("E3:E"&ROW($E$3:$E$6));">0"))))
Ctrl+Shift+Enter in P3 and copy down
CR
In the first cell of your desired output column (E1 in this example), enter
=B1
Where B1 is the address of the first object. In the cell below (E2, here), enter
=IF(COUNTIF(E$1:E1,E1)=INDEX($A$1:$A$3,MATCH(E1,$B$1:$B$3,0)),
INDEX($B$1:$B$3,MATCH(E1,$B$1:$B$3,0)+1),
E1)
And fill down as far as you require.
Assuming you have a small finite number of objects like in your example, try this:
In a blank sheet, put your example table in the top left. So Cell A2=3, B2="A", A3=2, etc.
In D2, enter "A" (this is just to get the formula started)
In D3, enter this formula:
IF(COUNTIF($D$2:D6,$B$2)<$A$2,$B$2,
IF(COUNTIF($D$2:D6,$B$3)<$A$3,$B$3,
IF(COUNTIF($D$2:D6,$B$4)<$A$4,$B$4)))
Fill this formula down (i.e. copy&paste) about 10 rows and you'll see everything fill in accordingly.
What does it do, you ask? First, it counts the number of occurrences of "A" in the previous cells of column D and compares it to the frequency. If less, it enters another A. Then that process is repeated for B and C.