Hello All,
I'm having a hard time getting a correct VLookup formula to find the result based on desired number. Please take a look at the sample in the attached file and help me out.
Regards,
tt3
Hello All,
I'm having a hard time getting a correct VLookup formula to find the result based on desired number. Please take a look at the sample in the attached file and help me out.
Regards,
tt3
Last edited by tuongtu3; 01-16-2013 at 08:54 PM. Reason: Solved
hi tt3. your table is pretty difficult to do a lookup. i did a static one you may have to manually adjust if your columns or requirements change.
=INDEX(Data!$B$2:$K$8,MATCH(D3,Data!$A$2:$A$8,0),LOOKUP(Y3,{1;25;50;100;250},{2,4,6,8,10}))
basically the red portion uses Qty in Y to lookup an exact match in these values {1;25;50;100;250}. if it can't find an exact match, it goes to the last biggest value. so for eg. Qty of 150 is no found, so the next biggest value is 100. it will then give me the result vector, which i input as {2,4,6,8,10}. hence, i'll get 8. that is actually the column number i want for my INDEX formula
Thanks, if you have clicked on the * and added our rep.
If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".
"Contentment is not the fulfillment of what you want, but the realization of what you already have."
Tips & Tutorials I Compiled | How to Get Quick & Good Answers
Hi benishiryo,
1. The correct number at Part7 should be 1 but formula gave number 0.
2. These values {1;25;50;100;250} in Sheets("Data") will not be the same. It could be any different numbers. When I changed the values (values {1;25;50;100;250}) then the result is wrong.
Can you take a look and see if you can help. Thank you very much for your time and help.
Regards,
tt3
hello All,
Any alternative method/formula to get a right reuslt would be great.
Regards,
tt3
try this array formula:
you have to paste the formula inside the formula bar & press CTRL + SHIFT + ENTERPlease Login or Register to view this content.
Hi benishiryo,
The code is perfect as I expect and I'm still thinking how to apply it to my ws.
Thnak you very much for your time and help.
regards,
tt3
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks