Find lowest value with conditions

Dani_LobP

Board Regular
Joined
Aug 16, 2019
Messages
126
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am trying to find the way to obtain the minimum value from a range, with some conditions.

So I have column A with some list of products, and each one have a list of countries (column B). Column A therefor has many duplicates, and Column B should be unique values, per each Col A value.
Then column C has some value. And the idea is, to make a formula that will take the range of the column A, for product A (example), and then from Column C, find the lowest option (by doing a "left(x,1)" to obtain the lowest number) and apply it to the whole product A (as mentioned as example). So each Product in col A will have same value in col D, being the smallest of the range.

ABCD
ProductCountryValueFormula result example
AAB1 - X1 - X
AAC2 - Y1 - X
AAD1 - X1 - X
BAB2 - Y1 - X
BAC3 - Z1 - X
BAD1 - X1 - X
CAE3 - Z3 - Z
CAB3 - Z3 - Z

Id like to think its making sense what i tried to explain. As for now my struggle is in making the condition. I'm currently using couple columns with CountIfs to obtain numbers and then comparing them columns to check if its same (in which case, would be easy to apply same value to all range) ... and when not, then find the smaller value and apply to them all. but i think I'm overdoing it and there might be easier way or a smartest formula to do all I am doing in a shorter way.

Thanks in advance!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
How about
Fluff.xlsm
ABCD
1ProductCountryValueFormula result example
2AAB1 - X1 - X
3AAC2 - Y1 - X
4AAD1 - X1 - X
5BAB2 - Y1 - Y
6BAC3 - Z1 - Y
7BAD1 - Y1 - Y
8CAE3 - Z3 - Z
9CAB3 - Z3 - Z
Master
Cell Formulas
RangeFormula
D2:D9D2=LET(s,SORTBY($A$2:$C$9,LEFT($C$2:$C$9,1)+0),TAKE(FILTER(INDEX(s,,3),INDEX(s,,1)=A2),1))
 
Upvote 0
How about
Fluff.xlsm
ABCD
1ProductCountryValueFormula result example
2AAB1 - X1 - X
3AAC2 - Y1 - X
4AAD1 - X1 - X
5BAB2 - Y1 - Y
6BAC3 - Z1 - Y
7BAD1 - Y1 - Y
8CAE3 - Z3 - Z
9CAB3 - Z3 - Z
Master
Cell Formulas
RangeFormula
D2:D9D2=LET(s,SORTBY($A$2:$C$9,LEFT($C$2:$C$9,1)+0),TAKE(FILTER(INDEX(s,,3),INDEX(s,,1)=A2),1))
thanks for your help once again!
hmm but not sure how to test it.
Reality is my column A in example is Column B in my table. Column B is my column E, (actually can ignore B from the formula cuz what matters is the number of rows for Product and Values... ). Column C is AV in my table. So unsure how to convert what you proposed in my scenario :D seems complex.
 
Upvote 0
How about
Excel Formula:
=LET(s,SORTBY($B$2:$AV$9,LEFT($AV$2:$AV$9,1)+0),TAKE(FILTER(TAKE(s,,-1),INDEX(s,,1)=B2),1))
 
Upvote 1
Solution
How about
Excel Formula:
=LET(s,SORTBY($B$2:$AV$9,LEFT($AV$2:$AV$9,1)+0),TAKE(FILTER(TAKE(s,,-1),INDEX(s,,1)=B2),1))
Thanks a lot! that will make it... i understand better now the formula too after you made the changes to adapt.
thanks!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,431
Messages
6,119,457
Members
448,898
Latest member
drewmorgan128

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top