Sort data list based on formula with interchanging signs (<,>,<=,>=) within the formula

rhogsett

New Member
Joined
Jul 23, 2014
Messages
16
Hello Everyone,

I am working with a large data set and and have a formula for generating a list (starting in D14) based on the highest value of Backlog $ within the set parameters starting in G14. The issue is that the parameters, largely the signs (<,>,<=,>=), are part of the formula, ie. {=IFERROR(LARGE(IF($B$3:$B$9>$I$14,IF($D$3:$D$9<=$I$16,IF($C$3:$C$9>=$I$15,$C$3:$C$3))),ROW(A1)),"-")}
I am hoping there is a way to have the signs in the formula to be replaced by cell references (H16,H17,& H18) so that any sign can be selected to adjust the desired output. Any suggestions on how to achieve this?

[TABLE="width: 793"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]DATA[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]Project[/TD]
[TD="align: center"]Creation Date[/TD]
[TD="align: center"]Backlog $[/TD]
[TD="align: center"]% Complete[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]1/15/2017[/TD]
[TD] $1,000[/TD]
[TD="align: center"]90%[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]3/15/2018[/TD]
[TD] $10,000[/TD]
[TD="align: center"]75%[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]4/1/2016[/TD]
[TD] $-[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]5/15/2018[/TD]
[TD] $5,000[/TD]
[TD="align: center"]10%[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]2/3/2017[/TD]
[TD] $3,000[/TD]
[TD="align: center"]85%[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]12/25/2017[/TD]
[TD] $15,000[/TD]
[TD="align: center"]75%[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]10/31/2016[/TD]
[TD] $1,000[/TD]
[TD="align: center"]98%[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]12[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]13[/TD]
[TD="align: center"]OUTPUT[/TD]
[TD="align: center"]Project[/TD]
[TD="align: center"]Creation Date[/TD]
[TD="align: center"]Backlog $[/TD]
[TD="align: center"]% Complete[/TD]
[TD="align: center"][/TD]
[TD]SEARCH PARAMETERS[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]14[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]12/25/2017[/TD]
[TD]$15,000[/TD]
[TD="align: center"]75%[/TD]
[TD="align: center"][/TD]
[TD]Creation Date[/TD]
[TD="align: center"]>[/TD]
[TD="align: right"]1/1/2017[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]15[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]3/15/2018[/TD]
[TD]$10,000[/TD]
[TD="align: center"]75%[/TD]
[TD="align: center"][/TD]
[TD]Backlog $[/TD]
[TD="align: center"]>[/TD]
[TD="align: right"] $2,000.00[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]16[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]5/15/2018[/TD]
[TD]$5,000[/TD]
[TD="align: center"]10%[/TD]
[TD="align: center"][/TD]
[TD]% Complete[/TD]
[TD="align: center"]<[/TD]
[TD="align: right"]100%[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]17[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]2/3/2017[/TD]
[TD]$3,000[/TD]
[TD="align: center"]85%[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]18[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]-[/TD]
[TD="align: center"]-[/TD]
[TD="align: center"] -[/TD]
[TD="align: center"]-[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]19[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]-[/TD]
[TD="align: center"]-[/TD]
[TD="align: center"] -[/TD]
[TD="align: center"]-[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]20[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]-[/TD]
[TD="align: center"]-[/TD]
[TD="align: center"] -[/TD]
[TD="align: center"]-[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Thank you in advance for your help!

RHOGSETT
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hello

Code:
' sheet module
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, [h17:h19]) Is Nothing Then
    [d14:d20].FormulaArray = _
    "=IFERROR(LARGE(IF($B$3:$B$9" & [h17] & "$I$14,IF($D$3:$D$9" & [h18] & _
    "=$I$16,IF($C$3:$C$9" & [h19] & "=$I$15,$C$3:$C$3))),ROW(A1)),"" - "")"
End If
End Sub
 
Upvote 0
Hello Everyone,

I am working with a large data set and and have a formula for generating a list (starting in D14) based on the highest value of Backlog $ within the set parameters starting in G14. The issue is that the parameters, largely the signs (<,>,<=,>=), are part of the formula, ie. {=IFERROR(LARGE(IF($B$3:$B$9>$I$14,IF($D$3:$D$9<=$I$16,IF($C$3:$C$9>=$I$15,$C$3:$C$3))),ROW(A1)),"-")}
I am hoping there is a way to have the signs in the formula to be replaced by cell references (H16,H17,& H18) so that any sign can be selected to adjust the desired output. Any suggestions on how to achieve this?

It's possible to achieve this, but with a large data set the performance of the spreadsheet would be poor. I think a macro is the proper solution.

Using formulas - something like


[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
A
[/TD]
[TD="bgcolor: #DCE6F1"]
B
[/TD]
[TD="bgcolor: #DCE6F1"]
C
[/TD]
[TD="bgcolor: #DCE6F1"]
D
[/TD]
[TD="bgcolor: #DCE6F1"]
E
[/TD]
[TD="bgcolor: #DCE6F1"]
F
[/TD]
[TD="bgcolor: #DCE6F1"]
G
[/TD]
[TD="bgcolor: #DCE6F1"]
H
[/TD]
[TD="bgcolor: #DCE6F1"]
I
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
DATA​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
Project​
[/TD]
[TD]
Creation Date​
[/TD]
[TD]
Backlog $​
[/TD]
[TD]
% Complete​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
A​
[/TD]
[TD]
01/15/2017​
[/TD]
[TD]
1000​
[/TD]
[TD]
90%​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
B​
[/TD]
[TD]
03/15/2018​
[/TD]
[TD]
10000​
[/TD]
[TD]
75%​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
C​
[/TD]
[TD]
04/01/2016​
[/TD]
[TD]
-​
[/TD]
[TD]
100%​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD]
D​
[/TD]
[TD]
05/15/2018​
[/TD]
[TD]
5000​
[/TD]
[TD]
10%​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
7
[/TD]
[TD]
E​
[/TD]
[TD]
02/03/2017​
[/TD]
[TD]
3000​
[/TD]
[TD]
85%​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
8
[/TD]
[TD]
F​
[/TD]
[TD]
12/25/2017​
[/TD]
[TD]
15000​
[/TD]
[TD]
75%​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
9
[/TD]
[TD]
G​
[/TD]
[TD]
10/31/2016​
[/TD]
[TD]
1000​
[/TD]
[TD]
98%​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
10
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
11
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
12
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
13
[/TD]
[TD]
OUTPUT​
[/TD]
[TD]
Project​
[/TD]
[TD]
Creation Date​
[/TD]
[TD]
Backlog $​
[/TD]
[TD]
% Complete​
[/TD]
[TD][/TD]
[TD]
SEARCH PARAMETERS​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
14
[/TD]
[TD]
1​
[/TD]
[TD]
F​
[/TD]
[TD]
12/25/2017​
[/TD]
[TD]
15000​
[/TD]
[TD]
75%​
[/TD]
[TD][/TD]
[TD]
Creation Date​
[/TD]
[TD]
>​
[/TD]
[TD]
01/01/2017​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
15
[/TD]
[TD]
2​
[/TD]
[TD]
B​
[/TD]
[TD]
03/15/2018​
[/TD]
[TD]
10000​
[/TD]
[TD]
75%​
[/TD]
[TD][/TD]
[TD]
Backlog $​
[/TD]
[TD]
>​
[/TD]
[TD]
2000​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
16
[/TD]
[TD]
3​
[/TD]
[TD]
D​
[/TD]
[TD]
05/15/2018​
[/TD]
[TD]
5000​
[/TD]
[TD]
10%​
[/TD]
[TD][/TD]
[TD]
% Complete​
[/TD]
[TD]
<​
[/TD]
[TD]
100%​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
17
[/TD]
[TD]
4​
[/TD]
[TD]
E​
[/TD]
[TD]
02/03/2017​
[/TD]
[TD]
3000​
[/TD]
[TD]
85%​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
18
[/TD]
[TD]
5​
[/TD]
[TD]
-​
[/TD]
[TD]
-​
[/TD]
[TD]
-​
[/TD]
[TD]
-​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
19
[/TD]
[TD]
6​
[/TD]
[TD]
-​
[/TD]
[TD]
-​
[/TD]
[TD]
-​
[/TD]
[TD]
-​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
20
[/TD]
[TD]
7​
[/TD]
[TD]
-​
[/TD]
[TD]
-​
[/TD]
[TD]
-​
[/TD]
[TD]
-​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Array formula in D14 copied down
=IFERROR(LARGE(IF(COUNTIFS(B$3:B$9,B$3:B$9,B$3:B$9,H$14&I$14),IF(COUNTIFS(C$3:C$9,C$3:C$9,C$3:C$9,H$15&I$15),IF(COUNTIFS(D$3:D$9,D$3:D$9,D$3:D$9,H$16&I$16),C$3:C$9))),A14),"-")
Ctrl+Shift+Enter

Array formula in B14 copied down
=IF(ISNUMBER(D14),INDEX(A$3:A$9,SMALL(IF(C$3:C$9=D14,ROW(C$3:C$9)-ROW(C$3)+1),COUNTIF(D$14:D14,D14))),"-")
Ctrl+Shift+Enter

Then you can use VLOOKUP to get the Creation Date and % Complete of each project.

M.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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