Counting duplicate occurrences in Excel with incremental letters instead of numbers - excel-formula

I'm trying to make a unique ID out of some duplicate amounts I have in a spreadsheet.
Right now I'm using the below formula.
=COUNTIF($A$1:A1,A1)&A1
What the formula is doing is attaching a incremental number by count of duplicate occurrences as in the below example:
Column A
295
295
295
Column B (Countif formula used)
1295
2295
3295
Which is great but things get tricky and I lose the uniqueness I was hoping to create if my column A has "2295" in row 4 for example:
Column A
295
295
295
2295
Column B (Countif formula used)
1295
2295 (Dupe)
3295
2295 (Dupe)
What I would like to do is add letters incrementing instead of numbers incrementing as I think that would solve my issue. Note just to think ahead but I think it still logically works just by increasing the letters I have some duplicate occurrences of amounts greater or equal to 25.
Column A
295
295
295
2295
Column B (Countif formula used)
A295
B295
C295
2295

Try this:
=CHAR(64+COUNTIF($A$1:A1,A1))&A1
=CHAR(65) will give you A

Related

Sum the values of a cell in Excel or change to a different expression of that value in another cell

I have a cell of a worksheet with a value of
1h 25m
entered with the cell (got it from a Jira import). I am trying to figure out how to populate another cell on the same row with a purely numerical version of this cell value, i.e.
85
This is so that I can run SUMIF statements to get the total amounts of minutes for a given person, on a given day.
As in the provided image, I want the sum total amount of Log Work (Column C) for Matthew R. on the 17th of October.
Here, we're creating two helper columns. You could combine everything, but thought this may be easier to illustrate.
Value
hours
minutes
sum
5m
0
5
5
1h 35m
1
35
95
3h
3
0
180
4h 55m
4
55
295
12h
12
0
720
Column A (Value) is your original value.
Column B (hours) is the following formula, which finds the letter "h" and returns everything to the left of it. If H is not found then return a 0.
=IFERROR(LEFT(A2,FIND("h",A2)-1),0)
Column C (minutes) is the following formula, which returns everything to the right of "h" and then removes "m" and trims it. But if "m" is not found then return a 0.
=IF(ISNUMBER(SEARCH("m",A2)),TRIM(SUBSTITUTE(IFERROR(RIGHT(A2,LEN(A2)-FIND("h",A2)),A2),"m","")),0)
Lastly, column D simply calculates total minutes as:
=(B2*60)+C2
You can probably shorten column C's formula, but this at least provides you an interim solution.

Count updated number of "ok" for each category but stop counting if value changes to "rej" or "blank"

Category A code
111 rej
111 ok
111 ok
222 ok
222
222 ok
222 ok
222 ok
33 ok
33 ok
33 ok
33 rej
33 ok
Answer: count updated (bottom to top)
111 - 2
222 - 3
33 - 1
To accomplish this with excel formulas, here's one way to do it.
Columns A and B contain your original data. Columns D and E are the original data in reverse order. Excel formulas generally work from the top down, instead of the bottom up. Reversing the original data makes it easier to use the formulas that follow. The formula for doing the reversing counts how many rows are left in the original data (ROWS(A2:$A$14)) and uses that as an index to the reversed value. So for D2 there are 13 rows (ROWS(A2:$A$14)), using INDEX that gets us A14. For D3 there are 12 rows (ROWS(A3:$A$14)), using INDEX that gets us A13...
Column F is where most of the work happens. The COUNTIFS is counting the number of rows that satisfy 2 conditions up to that point. The first condition is that the row must be equal to the category we're examining (so for F2 this would be D2 (33), for F8 this would be D8 (222)). The second condition is that the code is not equal to "ok". So for example the formula in F5 is counting the number of rows, between D2:D5 with a category of 33 and a code != "ok", the result is 1 (E3 is the only one).
To get the final counts we count the number of rows equal to the category we're counting, that have a count (Col F value) equal to zero.

Assigning the same value to different cells according to the rank of a matching cell's group

I have an Excel sheet that has values repeating in different rows of the same column (Obtain Marks). In RANKS column I want a grade assigned.
My problem is assigning the same rank to cells having the same Obtain Marks values.
How do I assign the same rank to the same Obtained Marks using an Excel formula?
Obtain Marks RANKS
212 1
212 1
212 1
211 2
210 3
209 4
209 4
Assuming Obtain Marks is in A1 and is sorted in order, if you want grouped by rank then I suggest in B2 and copied down to suit:
=RANK(A2,A$2:A$7,)
If you post includes under RANK the desired output then I suggest instead 1 in B2 and in B3 and copied down to suit:
=IF(A2=A3,B2,B2+1)
Either way each group should have a distinct value.
You can derive a pseudo-RANK.UNIQUE formula by modifying an old standard method of a SUMPRODUCT-style COUNT.UNIQUE formula.
        
The formula in B2 is,
=SUMPRODUCT((A$2:A$8>=A2)/COUNTIF(A$2:A$8, A$2:A$8&""))
Fill down as necessary.

Calculate standard deviation of same text values between cells in same column

The last few days I have been trying to create a macro in Excel which can calculate standard deviation which will take values from column B of same text values between different cells in column A and give the result in corresponding cell in column C. In my sheet there are lots of different text values in column A and corresponding value in column B. I want to take all values of column B from first row to last row of corresponding same text in column A and calculate the standard deviation of these values and shows the result in column C.
As an example, when it starts from first cell (aass) then it has to count all aass and take values from corresponding cell of column B after that calculate standard deviation. Please help me out.I will be happy to hear from you guys. I am trying to show how my sheet which will look like as below:
column A column B column C
text value result(standard deviation)
aass 112 35.16
aadd 243 12.9
ffdd 523 108.55
aass 198 35.16
aadd 252 12.9
aass 136 35.16
ffdd 342 108.55
ffdd 312 108.55
aadd 222 12.9
aadd 255 12.9
ffdd 322 108.55
aass 112 35.16
jjhgf 487 25.8
pouwe 565 6
jjhgf 451 25.8
jjhgf 424 25.8
qwert 643 0
pouwe 553 5
qwert 643 0
..... .... ...
..... .... ...
This is what I used without VBA. This is an array formula (entered using Ctrl+Shift+Enter) which resides in cell C1:
=STDEV(IF($A$1:$A$9=A1,$B$1:$B$9))
(In in my example file I have only 9 rows of data.)
In newer versions of Excel you can use this:
=STDEV.S(IF($A$1:$A$9=A1,$B$1:$B$9))
For the entire population use this:
=STDEVP(IF($A$1:$A$9=A1,$B$1:$B$9))
or
=STDEV.P(IF($A$1:$A$9=A1,$B$1:$B$9))
The following versions will be MUCH SLOWER:
=STDEV(IF(A:A=A1,B:B)) , =STDEV.S(IF(A:A=A1,B:B)) ,
=STDEVP(IF(A:A=A1,B:B)) , =STDEV.P(IF(A:A=A1,B:B)).
I will show you what I mean by a Table with structured references.
I copied your data for the text and value columns. I also added the header: Result to cell C1.
I then selected the Table option from the Insert ribbon (on the Tables tab)
I then entered this formula in C2 as an array formula, confirming it by holding down ctrl+shift while hitting Enter
=STDEVP(IF(Table1[[#This Row],[text]]=[text],[value],""))
Excel automagically copied that formula down to the last row and produced the requested results. If you now add a row, the table will extend (including the formula). You can also add columns with different formulas.
In the formula above, Table1[[#This Row],[text]] refers to the context of the text column only on the row containing the formula, and [text] by itself refers to the entire text column; [value] refers to the entire value column.
The autoextension, and the ability to use the actual column labels is a desireable feature of Excel tables and structured references. It is similar to having dynamic named ranges, but easier to implement.

Excel multi-column averages

I need to take the value in two data columns A and C, get a percentage by dividing the current value of columns A and C by the top value (which is a total), and then average the two percentages and spit them out in column D. For example D2 should be (100(226/508)+(100(218/490))) / 2). I'd prefer to do this with one equation - is it possible?
A B C D
1 508 490
2 226 44.49% 218
3 229 45.08% 221
The formula you want is
=(100*A2/A$1 + 100 *C2/C$1)/2
and the select all of column D downwards and then edit->fill down
The relative reference A2 will change in each row to the new row but A$1 is an absolute reference and will stay as the value in row 1.
You can also do this with array formula that do the fill down for you. See MS article

Resources