Nov 27 2019 12:22 PM - edited Nov 27 2019 12:24 PM
So I'm a novice but slowly getting the hang of this.
I currently am working off of two tabs in a workbook. One lists products and prices, the other is a table where you can enter products and the corresponding price shows up (using vlookup).
I'm wondering if it's possible to use IF formulas so that when a product is entered, if a quantity is over 5, the VLOOKUP looks in a different column.
For example, this is the code I have right now to find the price based on the part number:
=IFERROR(VLOOKUP(A6,'0919.1'!1:1048576,2,FALSE),0)
It is set to look for prices listed in column 2 on the price list.
(I use the if-error because if there is nothing listed I need it to say $0.00)
I would like to have a separate IF formula that uses VLOOKUP to find prices listed in column 6 if the quantity is higher than a certain number. I've found some things, but I always end up with #REF or FALSE instead of a price (=IF(A6>5,VLOOKUP(A6,'0919.1'!1:1048576,6,FALSE)) is one I tried)
Is this doable?
Nov 27 2019 12:30 PM - edited Nov 27 2019 12:31 PM
Solution@laurenb If the result of the first VLOOKUP is > 5, then something like this should work:
=IFERROR(IF(VLOOKUP(A6,'0919.1'!A:N,2,FALSE)>5,VLOOKUP(A6,'0919.1'!A:N,6,FALSE),VLOOKUP(A6,'0919.1'!A:N,2,FALSE)),0)
You'll need to adjust your column references to suit.
HTH
Nov 27 2019 12:34 PM - edited Nov 27 2019 12:34 PM
Nov 27 2019 01:29 PM
Is there also a formula to add so that if the redirect column (6) is empty, it goes back to column 2?
I tested it and it works great as you gave it to me! The only issue is that if there is no price for increased quantity it defaults to 0 instead of defaulting back to column 2.
I tried a few workarounds, but I keep getting errors.
Nov 27 2019 01:41 PM - edited Nov 27 2019 01:43 PM
@laurenb This is probably a bit overkill, but seems to work OK:
=IFERROR(IF(VLOOKUP(A6,'0919.1'!A:N,2,FALSE)>5,IF(VLOOKUP(A6,'0919.1'!A:N,6,FALSE)=0,VLOOKUP(A6,'0919.1'!A:N,2,FALSE),VLOOKUP(A6,'0919.1'!A:N,6,FALSE)),VLOOKUP(A6,'0919.1'!A:N,2,FALSE)),0)
Nov 27 2019 01:49 PM
I had to tweak it a little bit for what I needed, but this worked great!
Thanks so much dude you saved me a huge headache here nothing I tried was working.
Nov 27 2019 02:11 PM
@laurenb Glad I could help! Have a great Thanksgiving!
Nov 27 2019 12:30 PM - edited Nov 27 2019 12:31 PM
Solution@laurenb If the result of the first VLOOKUP is > 5, then something like this should work:
=IFERROR(IF(VLOOKUP(A6,'0919.1'!A:N,2,FALSE)>5,VLOOKUP(A6,'0919.1'!A:N,6,FALSE),VLOOKUP(A6,'0919.1'!A:N,2,FALSE)),0)
You'll need to adjust your column references to suit.
HTH