Forum Discussion
RKD2313
Sep 21, 2022Copper Contributor
Assistance With Trying To Find The Largest Discrepancy Between 2 Rows/1000+ Columns of Data
How can I find and sort the largest/smallest discrepancy between the values in 2 cells? For Example: Lets say Row C and Row D are prices and I want to find which column(s) have the largest/smalle...
Martin_Weiss
Sep 21, 2022Bronze Contributor
Hi RKD2313
easiest solution: calculate the difference between column C and column D in a separate column (e.g. column E).
=D1-C1
And then sort the list in a descending order by column E
DexterG_III
Sep 22, 2022Iron Contributor
Martin_Weiss The only other consideration I could offer is using ABS(D1-C1) so that negative or positive bias is treated with the same weight for discrepancy. 100-2 and 2-100 are the same discrepancy but wouldn't be sorted as such with one being 98 and the other being -98. Using ABS would force both to be 98 and sorted accordingly.
- RKD2313Sep 22, 2022Copper ContributorThanks for your reply as well. To give more specific insight I replied with more details.
- Juliano-PetrukioSep 22, 2022Bronze Contributor
Without a sample is a bit difficult to properly understand your needs.
Well, find attached one possible solution based in what I could understand.=TRANSPOSE(FILTER(A1:K2,LAMBDA(amazon,ebay,ABS(amazon<ebay))(A2:K2,A3:K3)=1))