SOLVED

Ranking text with multiple periods

%3CLINGO-SUB%20id%3D%22lingo-sub-1350315%22%20slang%3D%22en-US%22%3ERanking%20text%20with%20multiple%20periods%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1350315%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I%20have%20a%20table%20with%20various%20references%20with%20multiple%20periods%20and%20i'm%20looking%20to%20RANK%20them%20from%20lowest%20to%20highest%20(1.2.3.2.1%20first%20the%201.7.1.1.2%20last).%20The%20table%20also%20contains%20blank%20cells%20which.%20Also%2C%20the%20references%20are%20being%20pulled%20from%20another%20table%20with%20a%20formula%20of%20%3DIF(LEFT(C5%2C1)%3D%221%22%2CC5%2C%22%22).%3C%2FP%3E%3CP%3EExample%3A%3C%2FP%3E%3CP%3E1.7.1.1.2%3CBR%20%2F%3E1.2.3.2.1%3CBR%20%2F%3E1.5.2.1.1%3CBR%20%2F%3E1.2.10.1.1%3C%2FP%3E%3CP%3E1.2.5.1.10%3C%2FP%3E%3CP%3EI've%20been%20trying%20to%20use%20%3DCOUNTIF(P%245%3AP%2440%2C%22%26lt%3B%3D%22%26amp%3BP5)%20but%20the%20blanks%20and%20the%20double%20digit%20reference%20(1.2.10.1.1)%20are%20throwing%20things%20off.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20anyone%20assist%3F%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1350315%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1350513%22%20slang%3D%22en-US%22%3ERe%3A%20Ranking%20text%20with%20multiple%20periods%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1350513%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F639845%22%20target%3D%22_blank%22%3E%40Si_Slack%3C%2FA%3E%26nbsp%3Bhello.%20If%20you're%20up%20for%20a%20bit%20of%20formula%20fun%2C%20this%20can%20be%20done%2C%20although%20you'll%20need%20a%20few%20helper%20columns.%20I'm%20assuming%20you%20want%20to%20perform%20this%20for%20only%20column%20P.%20If%20you%20wanted%20to%20rank%20all%20WBS%23%20together%20(e.g.%20from%20column%20C)%20it%20can%20be%20done%2C%20you'd%20just%20need%20the%20below%20formulas%20and%20point%20to%20that%20column.%20If%20you%20want%20it%20for%20each%20'Table1'%2C%20'Table2'%2C%20'Table3'%2C%20etc.%2C%20you'll%20need%20each%20of%20the%207%20calculated%20columns%20for%20each.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20below%20solution%20consists%20of%207%20total%20columns%3A%205%20columns%20to%20extract%20each%20quintet%20item%2C%201%20column%20to%20assign%20a%20value%2C%20and%201%20column%20to%20perform%20the%20rank.%20The%20formulas%20are%20based%20on%20your%20example%20looking%20at%20column%20P.%20They%20start%20on%20row%205.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20extract%20each%20quintet%20item%2C%20enter%20the%20formula%20in%20Z5%3AAD40%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DIF(%24P5%3D%22%22%2C%22%22%2CTRIM(MID(SUBSTITUTE(%24P5%2C%22.%22%2CREPT(%22%20%22%2CLEN(%24P5)))%2C(COLUMN(A%241)-1)*LEN(%24P5)%2B1%2CLEN(%24P5))))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20assign%20a%20value%20to%20the%20extracted%20parts%2C%20enter%20the%20formula%20in%20AE5%3AAE40%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DIFERROR(SUMPRODUCT(Z5%3AAD5*(((COLUMN(%24A%241%3A%24E%241)-6)*-1)%5E10))%2C%22%22)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20assign%20a%20rank%20to%20the%20values%2C%20enter%20the%20formula%20in%20AF5%3AAF40%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DIFERROR(RANK(AE5%2C%24AE%245%3A%24AE%2440%2C1)%2C%22%22)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20could%20get%20messy%20if%20you%20want%20to%20do%20them%20for%20each%20'Table'%20item%20you%20have%20as%20opposed%20to%20ranking%20them%20all%20against%20each%20other%2C%20although%20I'm%20not%20sure%20the%20exact%20need%20or%20specifications%20if%20that%20is%20possible%20or%20not.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHTH%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1353695%22%20slang%3D%22en-US%22%3ERe%3A%20Ranking%20text%20with%20multiple%20periods%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1353695%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20the%20help%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F10842%22%20target%3D%22_blank%22%3E%40Zack%20Barresse%3C%2FA%3E.%20This%20worked%20a%20treat!!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hi, I have a table with various references with multiple periods and i'm looking to RANK them from lowest to highest (1.2.3.2.1 first the 1.7.1.1.2 last). The table also contains blank cells which. Also, the references are being pulled from another table with a formula of =IF(LEFT(C5,1)="1",C5,"").

Example:

1.7.1.1.2
1.2.3.2.1
1.5.2.1.1
1.2.10.1.1

1.2.5.1.10

I've been trying to use =COUNTIF(P$5:P$40,"<="&P5) but the blanks and the double digit reference (1.2.10.1.1) are throwing things off.

 

Can anyone assist?

Thanks

2 Replies
Highlighted
Best Response confirmed by Si_Slack (Occasional Contributor)
Solution

@Si_Slack hello. If you're up for a bit of formula fun, this can be done, although you'll need a few helper columns. I'm assuming you want to perform this for only column P. If you wanted to rank all WBS# together (e.g. from column C) it can be done, you'd just need the below formulas and point to that column. If you want it for each 'Table1', 'Table2', 'Table3', etc., you'll need each of the 7 calculated columns for each.

 

The below solution consists of 7 total columns: 5 columns to extract each quintet item, 1 column to assign a value, and 1 column to perform the rank. The formulas are based on your example looking at column P. They start on row 5.

 

To extract each quintet item, enter the formula in Z5:AD40:

 

=IF($P5="","",TRIM(MID(SUBSTITUTE($P5,".",REPT(" ",LEN($P5))),(COLUMN(A$1)-1)*LEN($P5)+1,LEN($P5))))

 

To assign a value to the extracted parts, enter the formula in AE5:AE40:

 

=IFERROR(SUMPRODUCT(Z5:AD5*(((COLUMN($A$1:$E$1)-6)*-1)^10)),"")

 

To assign a rank to the values, enter the formula in AF5:AF40:

 

=IFERROR(RANK(AE5,$AE$5:$AE$40,1),"")

 

This could get messy if you want to do them for each 'Table' item you have as opposed to ranking them all against each other, although I'm not sure the exact need or specifications if that is possible or not.

 

HTH

Highlighted

Thanks for the help @Zack Barresse. This worked a treat!!