Quantumplating
New Member
- Joined
- Aug 24, 2017
- Messages
- 2
Hello All,
I have challenge for you. Below I have a simple table (This is actually in a table so all of the columns are able to be sorted by row) with a series of columns and a hodge podge of made up data. The first two columns are raw data that I will manually be entering, and I want to be able to sort those columns using the table sorting. I have a few helper columns that then take the data and sort it into the sorted data column. That means regardless of the order of the data in the first columns the sorted data will always be sorted. I have that working after scrutinizing the web for a while.
Here are the formulas for the helper columns:
Helper 1 =COUNTIF([Raw Data],"<="&I4)
Helper 2 =--ISNUMBER(I4)
Helper 3 =--ISBLANK(I4)
Helper 4 =IF(ISNUMBER(I4),K4,IF(ISBLANK(I4),K4,K4+$L$1))+$M$1
And here is the formula for the sorting cell:
Sorted Data =IFERROR(INDEX([Raw Data],MATCH(SMALL([Helper 4],ROWS($O$4:[@[Sorted Data]])+$M$1),[Helper 4],0)),"")
I want the data in the column next to it (currently called column1) to be permanently sorted based on the sorted data in the sorted data column. For example US has a two next to all of the entries but it should have a 98798 next to one of the 4 duplicate entries in column 1. Notice too that power and exit are not next to each other in the sorted data. What is the formula to sort column1 1 based on the sorted data column?
[TABLE="width: 647"]
<tbody>[TR]
[TD]Raw Data[/TD]
[TD]Raw Data 2[/TD]
[TD]Helper 1[/TD]
[TD]Helper 2[/TD]
[TD]Helper 3[/TD]
[TD]Helper 4[/TD]
[TD]Sorted Data[/TD]
[TD]Column1[/TD]
[/TR]
[TR]
[TD]US[/TD]
[TD]2[/TD]
[TD]15[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]20[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]US[/TD]
[TD]2[/TD]
[TD]15[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]20[/TD]
[TD]234[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]US[/TD]
[TD]2[/TD]
[TD]15[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]20[/TD]
[TD]444[/TD]
[TD]Cow[/TD]
[/TR]
[TR]
[TD]Sp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D][/TD]
[TD]Cow[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]UAE[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]444[/TD]
[TD]Exit[/TD]
[TD]3[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]5[/TD]
[TD]US[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Power[/TD]
[TD]Wheat[/TD]
[TD]7[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]12[/TD]
[TD]US[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Snars[/TD]
[TD]Wisper[/TD]
[TD]9[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]14[/TD]
[TD]US[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Waffles[/TD]
[TD][/TD]
[TD]16[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]21[/TD]
[TD]US[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Sickness[/TD]
[TD][/TD]
[TD]8[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]13[/TD]
[TD]Waffles[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]Love[/TD]
[TD][/TD]
[TD]6[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]11[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Chicken[/TD]
[TD][/TD]
[TD]3[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]8[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I appreciate the help.
Sincerely,
Quantumplating
I have challenge for you. Below I have a simple table (This is actually in a table so all of the columns are able to be sorted by row) with a series of columns and a hodge podge of made up data. The first two columns are raw data that I will manually be entering, and I want to be able to sort those columns using the table sorting. I have a few helper columns that then take the data and sort it into the sorted data column. That means regardless of the order of the data in the first columns the sorted data will always be sorted. I have that working after scrutinizing the web for a while.
Here are the formulas for the helper columns:
Helper 1 =COUNTIF([Raw Data],"<="&I4)
Helper 2 =--ISNUMBER(I4)
Helper 3 =--ISBLANK(I4)
Helper 4 =IF(ISNUMBER(I4),K4,IF(ISBLANK(I4),K4,K4+$L$1))+$M$1
And here is the formula for the sorting cell:
Sorted Data =IFERROR(INDEX([Raw Data],MATCH(SMALL([Helper 4],ROWS($O$4:[@[Sorted Data]])+$M$1),[Helper 4],0)),"")
I want the data in the column next to it (currently called column1) to be permanently sorted based on the sorted data in the sorted data column. For example US has a two next to all of the entries but it should have a 98798 next to one of the 4 duplicate entries in column 1. Notice too that power and exit are not next to each other in the sorted data. What is the formula to sort column1 1 based on the sorted data column?
[TABLE="width: 647"]
<tbody>[TR]
[TD]Raw Data[/TD]
[TD]Raw Data 2[/TD]
[TD]Helper 1[/TD]
[TD]Helper 2[/TD]
[TD]Helper 3[/TD]
[TD]Helper 4[/TD]
[TD]Sorted Data[/TD]
[TD]Column1[/TD]
[/TR]
[TR]
[TD]US[/TD]
[TD]2[/TD]
[TD]15[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]20[/TD]
[TD]123[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]US[/TD]
[TD]2[/TD]
[TD]15[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]20[/TD]
[TD]234[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]US[/TD]
[TD]2[/TD]
[TD]15[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]20[/TD]
[TD]444[/TD]
[TD]Cow[/TD]
[/TR]
[TR]
[TD]Spain[/TD]
[TD]2[/TD]
[TD]10[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]15[/TD]
[TD]Cheese[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]FAIR[/TD]
[TD]2[/TD]
[TD]4[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]9[/TD]
[TD]Chicken[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]234[/TD]
[TD]2[/TD]
[TD]2[/TD]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