# vba condition is returning error

I have a formula in List1 that should return one formula if value is >150 and another if <=150
However, the >150 formula results in an error. If I try typing the formula in, I get the correct result.

Can anyone help? I am completely stumped and need to finish this very quickly.
I have attached project.

``````=(ROUND(IF(INDIRECT("M"&ROW())>150,(VLOOKUP(INDIRECT("M"&ROW()),INDIRECT("S"&ROW()),INDIRECT("L"&ROW()),TRUE)/150)*ROUNDUP(INDIRECT("M"&ROW()),0),IF(INDIRECT("M"&ROW())<=150,VLOOKUP(INDIRECT("M"&ROW()),INDIRECT(INDIRECT("S"&ROW())),INDIRECT("L"&ROW()),FALSE),"REMOVE")),2))*INDIRECT("H"&ROW())
``````
What-if-scenario-v6.4.xlsm
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
it returns error because in your lookup table: GR_2015, there is no Weight (in Lbs ) > 150.

Pls tell us the condition how you wish to handle that.
0
Commented:
if Current Dim > 150, will you lookup to the table according to the value in Column S?
0
Author Commented:
it returns error because in your lookup table: GR_2015, there is no Weight (in Lbs ) > 150.

Pls tell us the condition how you wish to handle that.

In this case it does the vlookup using TRUE, which finds the 150 weight and divides the amount/150.

Yes, it uses S as a named table range lookup.
0
Commented:
for column AG, try formula:
``````=(ROUND(IF(INDIRECT("M"&ROW())>150,(VLOOKUP(INDIRECT("M"&ROW()),INDIRECT(INDIRECT("S"&ROW())),INDIRECT("L"&ROW()),TRUE)/150)*ROUNDUP(INDIRECT("M"&ROW()),0),IF(INDIRECT("M"&ROW())<=150,VLOOKUP(INDIRECT("M"&ROW()),INDIRECT(INDIRECT("S"&ROW())),INDIRECT("L"&ROW()),FALSE),"REMOVE")),2))*INDIRECT("H"&ROW())
``````

for column AH, try formula:
``````=(ROUND(IF(INDIRECT("N"&ROW())>150,(VLOOKUP(INDIRECT("N"&ROW()),INDIRECT(INDIRECT("T"&ROW())),INDIRECT("L"&ROW()),TRUE)/150)*ROUNDUP(INDIRECT("N"&ROW()),0),IF(INDIRECT("N"&ROW())<=150,VLOOKUP(INDIRECT("N"&ROW()),INDIRECT(INDIRECT("T"&ROW())),INDIRECT("L"&ROW()),FALSE),"REMOVE")),2))*INDIRECT("H"&ROW())
``````

pls verify the results accordingly.
What-if-scenario-v6.4_b.xlsm
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.