Stock generate in drop down list

rameshppc

Board Regular
Joined
Jun 10, 2017
Messages
114
Office Version
  1. 2013
Platform
  1. Windows
Hi Good evening,

I am always happy to get your magical solutions for challenging questions...

I am working in a excel which contains school bag, travel bag & lunch bag inward informations as below..
s no
date
bag description
rate
qty
total value
selling price
1
01/12/2018
school bag - A
380
1380
490
2
01/12/2018
school bag - B
350
2
700
460
3
02/12/2018
lunch bag - A
65
1
65
100
4
02/12/2018
travel bag - A
250
2
500
400

<tbody>
</tbody>

I need to pay the manufacturer, once its sold. so i have below excel to follow this,
s no
sold date
bag description
sold qty
sold price
total value
pay manufacturer amount
issued amount
issued date
1
07/12/2018
school bag - B
2
600
1200

<tbody>
</tbody>
Here i need the stock information in bag description column as a drop down list.
If i sold the school bag - B 2nos, then next row this bag description should not show in drop down list.
Also need your suggestion to find the stock quantity also...

I will thanks a lot, which helps me to save the time for working with this excel chart...
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
I understand that, its really challenging one...

I think some one analyzing and get back me soon...

Thanks..
 
Upvote 0
Hi rameshpcc,

I am basing my solution on three assumptions:

  1. Your first table is in Sheet1, cells A1:G5
  2. Your second table is in Sheet2, cells A1:I2 (both assumptions ensure that your "bag description" item is always present in column C)
  3. Your maximum data range is 20 rows

You can now create Sheet3 and calculate the following:

Cell A1 label -> "Sheet1 - Sheet2"
Cells A2 to A20 formula ->
=IF(LEN(Sheet1!C2),IF(ISNA(VLOOKUP(Sheet1!C2,Sheet2!C:C,1,0)),Sheet1!C2,""),"")
You will notice that column A presents all "bag description" items extracted from Sheet1 excluding those already selected on Sheet2.

Cell B1 label -> "Drop-down list"
Cells B2 to B20 formula (Array formula - enter with Ctrl+Shift+Enter) ->
=IFERROR(INDEX($A$2:$A$20,SMALL(IF($A$2:$A$20<>"",ROW($A$2:$A$20)-1,""),ROW(B1))),"")
Column B presents exactly the same information as column A, with blank rows removed.

Now the only thing remaining is to create your dynamic drop-down list.
Data > Data Validation > List > Source (formula):
=OFFSET($B$2,0,0,COUNTA(B2:B20)-COUNTBLANK(B2:B20),1)

Hope it works for you. Let me know if anything is unclear.
 
Upvote 0
Hi Justy,

You are great in finding solutions...

i am getting an error while doing drop-down list in sheet 3 -> b2 to b20 as "The list source must be a delimited list or a reference to single row or column"

Can you pls help me on this...

And, i want to know how this formula will work on below case,

If the available stock of bag description "School bag - B" is "2" (qty) and if i enter the bag description "School bag - B" is "1" (qty) in sheet 2,

Then, may i know the balance qty "1" will show in drop down?
 
Upvote 0
Hey,

I think it might be caused by the lack of absolute references in our "dynamic drop-down list" formula. Try fixing it as follows (Data Validation > List > Source):
=OFFSET($B$2,0,0,COUNTA($B$2:$B$20)-COUNTBLANK($B$2:$B$20),1)
Once fixed, stay on "Data Validation" window and click on Source formula window. If the formula is working, it should highlight the correct range in column B.

As for your second question, that's not how it is currently designed - once you select a given item, it will disappear from the drop-down list. If you want to include the Quantity check, then you need to sum the Quantity sold (Sheet 2) and compare it with a number of available items (Quantity in Sheet1). Simply replace formula on Sheet3, right under "Sheet1 - Sheet2" header, with the following syntax:
=IF(LEN(Sheet1!C2),IF(SUMIFS(Sheet2!D:D,Sheet2!C:C,Sheet1!C2)<Sheet1!E2,Sheet1!C2,""),"")
 
Upvote 0
hi justy,

I got an error as "The source currently evaluates to an error. Do you want to continue?"

If i click the ok button, the dropdown arrow mark in b2:b20 not working..
 
Upvote 0
It's hard to tell what is causing an error. Would it be possible for you to upload the file and share the link here? I'll then check what exactly is happening.
 
Upvote 0
Cool, thanks! Don't have access to dropbox on this machine - I'll check it later today and let you know the results.
 
Upvote 0

Forum statistics

Threads
1,214,529
Messages
6,120,070
Members
448,943
Latest member
sharmarick

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