04-23-2019 09:41 AM
04-23-2019 09:41 AM
I am trying to sort the horizonal values in the first row based upon the values in the second row and have the result be similar to the vertical table to the right
I keep getting #num or it only returns one value
I had so many formulas I tried I am not putting them up so this is a blank slate for the formula
04-23-2019 10:15 AM
You may first create helper column to find the positions with with the large to small in totals (in P2)
based on that position you may select values from other rows like
Drag the all down till first empty cells appear.
04-23-2019 10:40 AM
@Sergei BaklanThanks that will work and luckily I have a place to hide the helper column close by
04-23-2019 11:20 AM
This is futures but a simple solution is coming to a computer near you!
Using modern Dynamic Arrays the formula in cell Q2
= SORT( TRANSPOSE(data), 2, -1 )
I will be so thankful to get rid of direct cell referencing and the practice of filling down single-cell formulas when a simple array is all that is needed!
04-23-2019 11:28 AM
@Peter Bartholomew , I used this to check if "traditional" formulas are correct...
04-23-2019 12:44 PM
I switched the values in row 12 to just numbers
Now when I run the helper column the zeroes give big numbers that lead to blanks in the results column
There may be no real way to do this but RA stands for advantage RN neutral and RD disadvantage
If I could somehow have the results column sort row9 such that first from large to small was the ones where RA was over 50 then the ones where RN was greater than RD followed by RN=RD and lastly RD sorted so the result would in this case be
MHH LHH LMH LMM HHH MMH LLH MMM LLL LLM
04-23-2019 01:23 PM
Yes, I assumed they are integers. Will correct in some while.
04-23-2019 03:03 PM
Answered from mobile previous time, open the computer and didn't catch how row 12 (RA) affects the Total (row 10) and what they shall be. Anyway, I reworked the formula to avoid helper column as
=IFERROR( INDEX($B$9:$N$9,1, AGGREGATE(14,6, 1/($B$10:$N$10=AGGREGATE(14,6,$B$10:$N$10,ROW()-ROW($P$1)))* COLUMN($B$10:$N$10), SUMPRODUCT(--($B$10:$N$10=AGGREGATE(14,6,$B$10:$N$10,ROW()-1))))-COLUMN($A$10)), "")
and now it shall not depend on which numbers are in Total row.
If again something is wrong please attach sample file there the issue is, from the text it's bit hard to understand without the knowledge what is behind your figures.
04-24-2019 02:54 AM
In the attached file, these are my formulas:
1. Q1, copied across to U1:
2. P2, copied down rows:
3. Q2, copied down rows and across to Column U:
04-29-2019 06:30 PM
SO here is the solution I came up with in the end
IN the Data set I added an infintessimal
Then I created 4 conditional helper columns to sort and return column numbers
Helper 1 The Best
Helper 2 The good
Helper 3 the not so good
Helper 4 I ranked them with small so the worst appear at the bottom of the list
SO the first 3 columns only have a few to zero values
Then I used this formula in my results column
This returned the values based on the column number in the helpers and ranked the results from best to worst
04-30-2019 04:08 AM
04-30-2019 05:03 AM
I had a go at using my normal methods (pre-dynamic arrays) but with limited success.
Because I used COUNTIFS to rank the terms, I had to introduce a helper row as the criterion range. The formula I used for the 'criteria' range was
= 100*(RA>50) + 10*(RN>RD) + (RN=RD)
[using a decimal place for each discrete sub-criterion]
The formula for ranking the terms by the criteria was
= 1 +
COUNTIFS(Criteria, ">"&Criteria) +
COUNTIFS(RD,">"&RD, Criteria, Criteria) +
COUNTIFS( k, "<"&k, Criteria, Criteria, RD, RD )
To place the results in rank order and transpose, I defined 'pointer' to be
= MATCH( TRANSPOSE(k), rank, 0)
That just leaves an array formula to output the result
= INDEX( Code, pointer )
I guess this doesn't look much like other people's solutions but it is still valid Excel and is about to get so much easier with modern dynamic arrays.
04-30-2019 06:19 AM
@TwifooI looked but your results didn't sort the subset results. And I couldnt see a simple way to modify this... The primary end goal is to have the LLL-HHH Values sorted from best to worst based on the criteria. I don't need or want any of the other data from the originating table transposed also. IN your results the one that was ^*% RA ended up down a ways instead of at the top for ex
04-30-2019 06:37 AM - edited 04-30-2019 06:38 AM
@Dichotomy66This picture shows my final results with the helper columns to the left. The numbers to the right of the colored columns are generated from a totally different table than the one is this problem.After getting the sorts done I then used conditional formatting to get the color indicators. I have tested it now with 3 different data sets of varying size and works great
by tomKG on June 03, 2020
by Ingeborg Hawighorst on May 13, 2020
by Brian Jones (OFFICE) on May 06, 2020