I am currently working on a reliability calculator and as part of a wider calculation, a loop is required where each line/row of components is checked, by inspecting the reliability value stated in their "Reliability of Configuration" column, to find whichever line/row offers the lowest reliability. Then additional quantities are added to that line until it's reliability exceeds the target reliability of the system, which is set by the user separately.
Within another column titled "Redundancy Configuration:" I have a drop down selection for the user to input whether a particular component is arranged within a "Standby", "Active, or "Series" configuration. What I need is the code above to run, but to omit any line/row in which the "Configuration:" column value is set to "Series".
I have managed to capture this in an excel formula below:
=MINIFS(Table_System[Reliability of Configuration],Table_System[Redundancy Configuration:],"<>Series")
However, I cannot get my VBA code attempt to run without error. Here is my best attempt so far:
'Add redundant units to any pieces of equipment with reliabilites lower than target
'Set Variables
DatRange = Worksheets(system).ListObjects("Table_" & system).ListColumns("Reliability of Configuration").DataBodyRange
DatRange2 = Worksheets(system).ListObjects("Table_" & system).ListColumns("Redundancy Configuration:").DataBodyRange
'minVal = Application.WorksheetFunction.Min(DatRange)
minVal = Application.WorksheetFunction.MinIfs(DatRange, DatRange2, "<>Series")
Do Until minVal > Target_Reliability
The commented out "minVal" would correctly identify the minimum value within the "Reliability of Configuration" column. But I can't get the MinIfs code to work to identify the correct minimum value, omitting series selection.
Please help!