IFs & VLOOKUP Help

Gbadd

New Member
Joined
Sep 12, 2014
Messages
7
I am trying to calculate the number of cases to pick for deliveries. I have a table that states how many each (base unit) is in a case. I need vlookup to find the amount in the table array and divide that value by the quantity listed in column D (base unit quantity). That's a simple vlookup but sometimes my report already has the number of cases that is needed to pick so the vlookup gives me an incorrect value. I tried to combine a IFs and vlookup but getting a #VALUE! error. My formula is =IFS(E3="CS",D3),D3/VLOOKUP(F3,base,10,FALSE) Maybe IFs is not what I need to use. Can someone help?
 

Attachments

  • Help.jpg
    Help.jpg
    102.9 KB · Views: 7

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
=IFS(E3="CS",D3),D3/VLOOKUP(F3,base,10,FALSE)

i cannot follow the image to well,

SO lets do it with an IF , as IFS has to evaluate all conditions - so i tend ti avoid that

If E3 = CS , then you want to display the value thats on D3
if E3 does not = CS then you want to divide D3 by a lookup value, which looks up the value in F3 in a range named base and brings back the 10th column from the starting reference column in the name base

=IF( E3="CS", D3, D3/VLOOKUP(F3,base,10,FALSE) )

BUT you will get an error if the vlookup cannot find F3 value in the first column of the range name 'BASE'
so you could use na IFERROR

Or if the value returned is a 0 or text it will also error -

Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
Do you need it to be IFs? which is usually used for multiple conditions?

What about:

=IF (E3 = "CS", D3, D3/Vlookup(F3, Base, 10,False)

Note I've not checked your formula itself, but have just taken it to be correct and slotted it into a simple IF statement.
 
Upvote 0
Ok so honestly I do not care what type of formula is used I just what results. Basically I need to convert the quantity in column D to case quantity if not already displayed as CS (cases). If column E is not "CS" I want excel to find the material in the table and take the base/case quantity (column Q) and divide it by delivery quantity (column D). If the value in column E is "CS" enter the value in column D into column J. I have made the values in column J to match what I want the end result to be. Can you supply a formula to get these results?
List For Picking.xlsx
BCDEFGHIJKLMNOPQR
2Table
3Delivery ItemDelivery quantitySUMaterialPlntSLocDescriptionValue I need returned
4878413691012EA12105PTMD796STCK6x5x1 LB SHOCK PLUS2MaterialDescriptionBase UoMBase/Case
587841369204EA15128PTMD796STCK4x1 GA ALG/CLRFR112105PTM6x5x1 LB SHOCK PLUSBOX6
687841369306EA15145PTMD796STCK6x1 QT ALG MAXBLUE115128PTM4x1 GA ALG/CLRFRBT4
787841369406EA17456STMD796STCK6x14 OZ BROM GRAN115145PTM6x1 QT ALG MAXBLUEBT6
887850251103CS42610BIOD796STCK4x4.5 LB SPA GRD BROM TAB317456STM6x14 OZ BROM GRANBT6
987850251203CS42640BIOD796STCK4x70 OZ SPA GRD SPA COMPLETE325768BIO6x2 LT POOL COMPLETE 911BT6
1087850251304CS25768BIOD796STCK6x2 LT POOL COMPLETE 911442610BIO4x4.5 LB SPA GRD BROM TABBT4
1142640BIO4x70 OZ SPA GRD SPA COMPLETEBT4
List For Picking
 
Upvote 0
Ok so honestly I do not care what type of formula is used I just what results.
did you try the formula

you have changed the example so now the vlookup is different from your orginal example

=IF( E3="CS", D3, D3/VLOOKUP(F3,$N$3:$Q$10,4,FALSE) )

so this works , with the 2nd example you gave - if the real data uses base as the range name and column 10 from the reference , then you will need to adapt

lookup and divide - ETAF.xlsx
ABCDEFGHIJKLMNOPQ
1Table
2Delivery ItemDelivery quantitySUMaterialPlntSLocDescriptionValue I need returnedFormula
3878413691012EA12105PTMD796STCK6x5x1 LB SHOCK PLUS22MaterialDescriptionBase UoMBase/Case
487841369204EA15128PTMD796STCK4x1 GA ALG/CLRFR1112105PTM6x5x1 LB SHOCK PLUSBOX6
587841369306EA15145PTMD796STCK6x1 QT ALG MAXBLUE1115128PTM4x1 GA ALG/CLRFRBT4
687841369406EA17456STMD796STCK6x14 OZ BROM GRAN1115145PTM6x1 QT ALG MAXBLUEBT6
787850251103CS42610BIOD796STCK4x4.5 LB SPA GRD BROM TAB3317456STM6x14 OZ BROM GRANBT6
887850251203CS42640BIOD796STCK4x70 OZ SPA GRD SPA COMPLETE3325768BIO6x2 LT POOL COMPLETE 911BT6
987850251304CS25768BIOD796STCK6x2 LT POOL COMPLETE 9114442610BIO4x4.5 LB SPA GRD BROM TABBT4
1042640BIO4x70 OZ SPA GRD SPA COMPLETEBT4
11
12
13
Sheet4
Cell Formulas
RangeFormula
K3:K9K3=IF( E3="CS", D3, D3/VLOOKUP(F3,$N$3:$Q$10,4,FALSE) )
 
Upvote 0
Solution

Forum statistics

Threads
1,214,522
Messages
6,120,020
Members
448,938
Latest member
Aaliya13

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top