Rank like Subtotals - excel

It's possible use Rank like Subtotals, that only use de showing data?.
If I filter data by a column, I want than Rank function only use these datas
Example
A B C The column C its Rank of column B
a 5 3
b 9 1
a 2 4
c 7 2
Now if I apply a filter in column A for value 'a'
A B C I want the rank recalculate with this new data
a 5 1 --> column C change from value 3 to value 1
a 2 2 --> column C change from value 4 to value 2
Thanks

You cannot do it by using RANK() formula, but you can create customizable rank formula. For this, You should add column at the and of table to indicate the row visibility, and put this formula into this column:
=(AGGREGATE(3;5;B2)>0)+0
Then put this formula into column C:
=SUMPRODUCT(($B$2:$B$9<B2)*($E$2:$E$9=1))+1
To check real example, download my sample file

Related

Ignore text values in subtotal function

Excel-Sheet:
A B C D E
1 1.200
2 Product A 500
3 Product B 400
4 Product C OK
5 Product D #NA
6 Product E 300
7
8
In the above table I have list of products in Column A and some data about the products in Column B.
In Cell B1 I want to calculated the subtotal of Column B using =SUBTOTAL(9,B2:B6).
However, now I have the issue that Column B not only consists of numbers.
It can also have the data type text (OK, NA). Therefore, the result in Cell B1 currently is #NA.
Is there any kind of formula that I could use so only the number data is considered and the result is 1.200 as in the table above?
Please note:
This function =AGGREGATE(9,6,B2:B6) won't help me because I want to filter the list later on so I need to go with the SUBTOTAL.
Use 7 as the second criterion in AGGREGATE instead of 6 as it will also exclude hidden rows:
=AGGREGATE(9,7,B2:B6)
You can solve this, combining the Excel worksheet functions =Value() and =IfERROR():
The function =Value() gives the value of a number, and in case of text it gives an error.
=IfError() can be used to give 0 in that case.
So, imagine you have following situation:
Column A Column B Column C
1 =Value(A1) =IfError(B1;0)
3.5 =Value(A2) =IfError(B2;0)
AB =Value(A3) =IfError(B3;0)
abc10 =Value(A4) =IfError(B4;0)
This gives following results:
Column A Column B Column C
1 1 1
3.5 3.5 3.5
AB #Value 0
abc10 #Value 0
You can simply take the sum of column C.
So this is based on the summary in B1.
=SUM(IF(ISERROR(B2:B6),"",B2:B6))
You need to push Ctrl+Shft+Enter for this to work.
Hope it helps.

Excel Data convert from single row to multiple row

I have data in excel in following manner.
Colname Count
A 5
B 3
C 4
I want to convert it into this way.
A 1
A 2
A 3
A 4
A 5
B 1
B 2
B 3
C 1
C 2
C 3
C 4
Based on the count i want that data must be converted into rows with increasing order. Please let me know the feasiblity .
=IF(ROW()<B$1+1,"A",IF(AND(ROW()>B$1,ROW()<SUM(B$1:B$2)+1),"B",IF(AND(ROW()>SUM(B$1:B$2),ROW()<SUM(B$1:B$3)+1),"C",""))) in F1 and fill down. In G1, this formula =IF(COUNTA(F1)>0,COUNTIF(F$1:F1,F1),"") and fill down. Letters are in Column A and numbers in Column B. I chose these columns randomly to work a solution. Change to match your actual data, if needed.

Look up for highest value from another column if values are equal excel

***1 2 3***
a 2 3
b 3 4
c 4 3
d 5 2
so I know to get the highest value I do
=INDEX(column1, MATCH(MAX(column3), column3, 0))
... which would give me 'b'
now I want to get the second highest value based on the column 3 but because there are two cells with 3 (which is the second highest value) I want to use the one that has the lowest value in column 2 based on those two rows. Is this possible?
Use a 'helper' column that adds column C + (column B ÷ 10) and use a modification of your original formula on that column.
        
The standard formula in F5 is,
=INDEX(A$2:A$5, MATCH(AGGREGATE(14, 6, D$2:D$5, ROW(1:1)), D$2:D$5, 0))
Fill down as necessary.

EXCEL match 2 columns against each other

I have two columns of data, they look something like this:
A B C D
1 2 SOME RECORD
2 6 SOME RECORD
3 10 SOME RECORD
4
5
6
7
8
9
10
So basically column A is a list of indices, where some of them appear in column C with corresponding records saved in column D. Column B is currently empty, and what I want to do is if say index 2 appears in both column A and column C (they matches), then put the record beside C2 in the cell B2. So essentially I want it to look like this:
A B C D
1 2 SOME RECORD
2 SOME RECORD 6 SOME RECORD
3 10 SOME RECORD
4
5
6 SOME RECORD
7
8
9
10 SOME RECORD
Can someone help please?!! Thanks!!!
UPDATE: I tried this and it doesn't work. The data in column D is calculated using a UDF and is refreshing every 1 second. The VLOOKUP function fails even though I can see the 2 indices are the same!! Is it because of the format of the cell or column? I.e. does vlookup compare data type as well?
Assuming your data in A starts from A1 - put in B1 the following and autofill:
=IFERROR(VLOOKUP($A1,$C:$D,2,0),"")
This includes handling of missing values.
You'll want this:
B1=VLOOKUP(A1, C:D, 2, FALSE)
This will look up the value in column A within the array spanning columns C and D. It will give you the value found in the second column (D). FALSE makes it an exact match, otherwise you might get 2 and 20 matching because hey, they're kind of similar...

Merge unique values if another cell matches

Merge all unique values if another cell matches. I already know how to merge cells but now some information is double. So what I would like to achieve is the following:
if column A has the same name, then all values given in column B for
that name must be given only ONCE in a new column.
My data has a row names and a row mode, for example (Row 1 is header)
A B
2 Brenda a
3 Brenda a
4 Joey a
5 Joey b
So I want:
E
2 a
3
4 a,b
5
I already did merge the modes in column 3:
=IF(A1<>A2;B2;C1&","&B2)
So I get in this example:
C
2 a
3 a,a
4 a
5 a,b
Then, I already did that only the first record get the additional modes in column 4:
=IF(A1=A2;"";INDEX(Sheet1!$C:$C;COUNTIF(Sheet1!$A:$A;$A2)+MATCH($A2;Sheet1!$A:$A;0) -1))
So I get in this example
D
2 a,a
3
4 a,b
5
Now I need a column that only uniques values are given for each name. So in this example:
E
2 a
3
4 a,b
5
If I am understanding how your data is structured, try this:
Add a new column, say column G for ease of explanation, that concatenates the name and mode in each row. So, cell G2="Brendaa", G3="Brendaa", G4="Joeya", G5="Joeyb", etc.
In your merge step you will test whether the current value in the cell for this column matches any previous values in the column: If no, you do the merge; if yes, you don't.
Your merge formula would change to something like the following:
=IF(A1<>A2,B2,IF(ISERROR(VLOOKUP(G2,G$1:G1,1,0)),C1&","&B2,""))
Then you would the next step as before.

Resources