South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
VLookup goes in cell E1

Cool, I've never used it like that before.=vlookup(a1,Range,2,FALSE)
TRUE = return an Approximate match (closest)
FALSE = Returns Exact match (exact else 0)
Why do you have blank columns in your named range? Blank columns are always bad. I have been training Excel for many years and I must admit that I have never seen a formula structure like this. Would love to know more about it. I assume it works but it looks complicated. Why are you bringing back the column you are searching and not the actual price ? And you are doing an approximate search - not an exact one. This has me very confused. I would love it if you would explain it.VLookup goes in cell E1
Price you use Name Manager under Formulas tab
View attachment 1021006
EDIT: Updated screen shot
To add more just use the starting quantity and the price. i.e. if you wanted to charge R7.00 for 500 + then add 500 in cell A5 and R7.00 in cell B5. Make sure you update Price in Name Manager if you go below A6:B6
Edit #2: Ooops should be TRUE not FALSE at the end (or leave it out it will default to TRUE). My bad.
=VLOOKUP(D1,Price,1)
I always use 0. And then encase the function in the IFNA, or IFERROR. Then you have it say whatever you want instead of #N/ACool, I've never used it like that before.![]()
You can leave space to add more rows. Previously VLookup only worked if you sorted the columns (edit: when using FALSE) , but they eventually fixed that. This way you don't have to keep updating Name Manager.Why do you have blank columns in your named range? Blank columns are always bad. I have been training Excel for many years and I must admit that I have never seen a formula structure like this. Would love to know more about it. I assume it works but it looks complicated. Why are you bringing back the column you are searching and not the actual price ? And you are doing an approximate search - not an exact one. This has me very confused. I would love it if you would explain it.
The IF function is so much easier than thisYou can leave space to add more rows. Previously VLookup only worked if you sorted the columns, but they eventually fixed that. This way you don't have to keep updating Name Manager.
If you use False (exact search), see my example columns G and H, you will get errors if the cell you are looking up doesn't exist. So you would have to add a price for every iteration 0 to 500. using approximant match it takes the closest match downwards. So 30, 29,....1 return what is in 1 not 31.

There is not a space in the lookup table. It consists of eight cells A1:B4.Why do you have blank columns in your named range? Blank columns are always bad. I have been training Excel for many years and I must admit that I have never seen a formula structure like this. Would love to know more about it. I assume it works but it looks complicated. Why are you bringing back the column you are searching and not the actual price ? And you are doing an approximate search - not an exact one. This has me very confused. I would love it if you would explain it.
That is why I posted it! I still think though that it is rather overkill for a simple application of the basic lookup function/s.There is not a space in the lookup table. It consists of eight cells A1:B4.
It is actually a cool way to accomplish the task.
And you have built in validation on the lookup cells?The IF function is so much easier than this
View attachment 1022008
I used absolutes as I assumed you would need to copy the formula down. If not - you don't need them.
I have nested if statements with like 15 columns. Some are if(and(bleh, blah)The IF function is so much easier than this
View attachment 1022008
I used absolutes as I assumed you would need to copy the formula down. If not - you don't need them.
The absolute worst SS around at the moment is the official load shedding schedules used by Eskom.I have nested if statements with like 15 columns. Some are if(and(bleh, blah)
Need to have a better way of doing this in the formulas, easily leads to logical errors
Will be changing to vba and "select case" at some stage, a lot neater, but didn't really want a macro enabled sheet
Nested IF's is such a PITA like this old chestnut I still use (too lazy to update it)The IF function is so much easier than this
View attachment 1022008
I used absolutes as I assumed you would need to copy the formula down. If not - you don't need them.
=B23 & IF(B23>0," ","") & C23 & IF(C23>0," ","")& D23 & IF(D23>0," ","") & PROPER(E23) & IF(A23="","",IF(B23>0," ",""))&IF(A23="","",IF(IFERROR(VLOOKUP(A23,Dry,1,FALSE),"")=A23," DRY OFF",""))
Sorry I forgot to mention that using TRUE (or leaving it out) the range needs to be sorted. Unsorted only works for FALSE.Previously VLookup only worked if you sorted the columns, but they eventually fixed that.
I use isblank(A23)Nested IF's is such a PITA like this old chestnut I still use (too lazy to update it)
Code:=B23 & IF(B23>0," ","") & C23 & IF(C23>0," ","")& D23 & IF(D23>0," ","") & PROPER(E23) & IF(A23="","",IF(B23>0," ",""))&IF(A23="","",IF(IFERROR(VLOOKUP(A23,Dry,1,FALSE),"")=A23," DRY OFF",""))