Home > Software design >  Match sequenced values in a row and a column
Match sequenced values in a row and a column

Time:10-05

I have a row that has cargo weight:

Weight 1 Weight 2 Weight 3 Weight 4 Weight 5 Weight 6 Weight 7
8 6 0 9 0 9 0

And a column that has the costs for it:

Costs
3595.11
4437.08
4939.34

The smallest cost matches the smallest cargo weight, the medium cost matches the medium cargo weight and so on. But these values are copied from another sheet so they are variable.

I'd like to have a function under the cargo weight row that matches the values as I explained in the line above and excludes zero. Does anyone know how it could be done?

Thank you in advance.

CodePudding user response:

If one has Office 365:

=IFERROR(INDEX(SORT($J$2:$J$4,,-1),MATCH(A2,SORT(UNIQUE($A$2:$G$2,TRUE),1,-1,TRUE),0)),0)

enter image description here

  • Related