Get the lowest range of columns

gigi79

New Member
Joined
Sep 18, 2012
Messages
34
Hello All,

I have three columns (D, E, and F) and any of those columns could have a value of "0-30", "31-60", "60-90", "91-180", "181 - 365" and "365"+.

I have a fourth column in which I need the lowest for those columns,

so of column D has 31-60, column E has 365+ and column F has 0-30, I need the fourth column (column B) to show 0-30.

I tried the Min, Small, and a few other formula mixes included nested "if" statement but I'm getting nothing but errors.
Any help would be appreciated.


 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Assuming you have Office 365 functions, how about
Excel Formula:
=LET(rng,D1:F1,secondPart,SUBSTITUTE(INDEX(SORT(VALUE(TEXTAFTER(SUBSTITUTE(rng,"+","-366"),"-"))),1,1),"366","365+"),IF(secondPart="365+","365+",CONCAT(INDEX(SORT(VALUE(SUBSTITUTE(TEXTSPLIT(rng,"-"),"+",""))),1,1),"-",secondPart)))
 
Last edited:
Upvote 0
=LET(rng,D1:F1,secondPart,SUBSTITUTE(INDEX(SORT(VALUE(TEXTAFTER(SUBSTITUTE(rng,"+","-366"),"-"))),1,1),"366","365+"),IF(secondPart="365+","365+",CONCAT(INDEX(SORT(VALUE(SUBSTITUTE(TEXTSPLIT(rng,"-"),"+",""))),1,1),"-",secondPart)))
this isn't working properly. Can you help me understand what it's doing? (Red is the formula result it should be the ones circled in blue).

I think some of the issue is that the columns can be either "181-365" or "365+" there is no 366 (there should be, but the date ranges overlap - not my doing or comtrol)

1701199831259.png
 
Upvote 0
Perhaps this:

Book1 11-27-2023.xlsx
DEFGH
1
291-18031-6060-9031-60
331-60365+0-300-30
4365+365+365+365+
5181-365181-365365+181-365
691-180181-365365+91-180
Sheet3
Cell Formulas
RangeFormula
H2:H6H2=LOOKUP(MIN(IF(IFERROR(SEARCH("+",$D2:$F2),0),365,LEFT($D2:$F2,FIND("-",$D2:$F2)-1)*1)),{0,31,60,91,181,365},{"0-30","31-60","60-90","91-180","181-365","365+"})
 
Upvote 1
Solution
Perhaps this:

Book1 11-27-2023.xlsx
DEFGH
1
291-18031-6060-9031-60
331-60365+0-300-30
4365+365+365+365+
5181-365181-365365+181-365
691-180181-365365+91-180
Sheet3
Cell Formulas
RangeFormula
H2:H6H2=LOOKUP(MIN(IF(IFERROR(SEARCH("+",$D2:$F2),0),365,LEFT($D2:$F2,FIND("-",$D2:$F2)-1)*1)),{0,31,60,91,181,365},{"0-30","31-60","60-90","91-180","181-365","365+"})
this works! Thank you!
 
Upvote 0
Perhaps this:

Book1 11-27-2023.xlsx
DEFGH
1
291-18031-6060-9031-60
331-60365+0-300-30
4365+365+365+365+
5181-365181-365365+181-365
691-180181-365365+91-180
Sheet3
Cell Formulas
RangeFormula
H2:H6H2=LOOKUP(MIN(IF(IFERROR(SEARCH("+",$D2:$F2),0),365,LEFT($D2:$F2,FIND("-",$D2:$F2)-1)*1)),{0,31,60,91,181,365},{"0-30","31-60","60-90","91-180","181-365","365+"})
I have a follow up question...one of the fields contains an error (it is a vlookup) which means the result formula is an error, is there a way to tweak that to ignore any error column and choose the value from the others?

(Result formula is in the red circle) - column D should be ignored since it is an error

1701203665517.png
 
Upvote 0
Yeah, wrap the whole formula in IFERROR(), like this perhaps:

Excel Formula:
=IFERROR(LOOKUP(MIN(IF(IFERROR(SEARCH("+",$D2:$F2),0),365,LEFT($D2:$F2,FIND("-",$D2:$F2)-1)*1)),{0,31,60,91,181,365},{"0-30","31-60","60-90","91-180","181-365","365+"}),"")
 
Upvote 0

Forum statistics

Threads
1,215,079
Messages
6,123,009
Members
449,093
Latest member
ikke

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