Link to home
Start Free TrialLog in
Avatar of Euro5
Euro5Flag for United States of America

asked on

VBA formula to compare and select largest value

On the "Reduced_Data" sheet, I need to take an additional step that I can't work into the formula.
For ONLY column A "F1", "F2", or "F3" -

Formulas in columns U, V, W X
Net Rates 1 OLD DIM      
=IF(VLOOKUP($S2,INDIRECT($A2&"_1"),$C2,TRUE)*$S2>VLOOKUP($S2,INDIRECT($A2&"_MIN_1"),$C2,TRUE),VLOOKUP($S2,INDIRECT($A2&"_1"),$C2,TRUE)*$S2,VLOOKUP($S2,INDIRECT($A2&"_MIN_1"),$C2,TRUE))

Open in new window


Net Rates 2 OLD DIM      
=IF(VLOOKUP($S2,INDIRECT($A2&"_2"),$C2,TRUE)*$S2>VLOOKUP($S2,INDIRECT($A2&"_MIN_2"),$C2,TRUE),VLOOKUP($S2,INDIRECT($A2&"_2"),$C2,TRUE)*$S2,VLOOKUP($S2,INDIRECT($A2&"_MIN_2"),$C2,TRUE))

Open in new window


Net Rates 1 NEW DIM      
=IF(VLOOKUP($T2,INDIRECT($A2&"_1"),$C2,TRUE)*$T2>VLOOKUP($T2,INDIRECT($A2&"_MIN_1"),$C2,TRUE),VLOOKUP($T2,INDIRECT($A2&"_1"),$C2,TRUE)*$T2,VLOOKUP($T2,INDIRECT($A2&"_MIN_1"),$C2,TRUE))

Open in new window


Net Rates 2 NEW DIM
=IF(VLOOKUP($T2,INDIRECT($A2&"_2"),$C2,TRUE)*$T2>VLOOKUP($T2,INDIRECT($A2&"_MIN_2"),$C2,TRUE),VLOOKUP($T2,INDIRECT($A2&"_2"),$C2,TRUE)*$T2,VLOOKUP($T2,INDIRECT($A2&"_MIN_2"),$C2,TRUE))

Open in new window


* Enter formulas (only in rows where column A = OR{"F1", "F2", "F3"})
* Copy down all rows each column
* Save as value
formula.xlsx
Avatar of Professor J
Professor J

please see attached.

i have added the requirement into the columns U, V, W X.

currently, you have REF error and that is not something caused with my formula, it is becuase you used indirect method for a reference lookup table which does not exist. i assume you know that.
formula.xlsx
Avatar of Euro5

ASKER

@ProfessorJimJam - is this a VBA or just formulas pasted in the excel file?
ASKER CERTIFIED SOLUTION
Avatar of Professor J
Professor J

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial