Need Help: Formula to sort stock in clothing company's computer system

rkobeyer

New Member
Joined
Jul 14, 2011
Messages
44
Hi there,

I really hope someone can help me, this job normally takes a whole day of mundane data entry to complete. This needs to be done twice a month so if I can do this with excel you will save me 3 weeks of boring work.

A product represented by an 'S Code' in Column A (see below) needs to have values put into the columns F,G & H that apply to that product.

if A2 = "100001" and any cell in column D also = "100001"
then input in cell F2=1, G2=2 and G2=3 then F3=1, G3=2 and G3=3 etc.
until row 11 where it wont enter anything because that has a different product "100019"

This product "100019" has a value of 0 in Column B therefore nothing should be entered in columns F,G & H

The formula then continues matching Column A with Column D until all data has been entered.

NOTE: Each "S Code" is one product which can have up to 9 "P Codes" which are codes for the product's different sizes.

ABCDEFGH
1 S CodeStockS CodeP CodeOn HandMin StockMax Stock
210000117100001100001123
31000190100001100002123
410002830100001100003123
51000373100001100004123
610005511100001100005123
71000645100001100006123
810007325100001100007123
91001009100001100008123
1010010915100001100009123
1110012728100019100019
1210013623100019100020
1310015416100019100021
1410016370100019100022
151001721100019100023
161001815100019100024
1710019017100019100025
1810020811100019100026
191002170100019100027
2010022628100028100028123
21100235-2100028100029123
2210025310100028100030123
231002801100028100031123
241002891100028100032123
2510029815100028100033123
261003161100028100034123
271003257100028100035123
28100334-4100028100036123

<tbody>
</tbody>


I hope I've explained this well, any questions please let me know.

Looking forward to hearing from you,

Russell
 
Last edited:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
This formula in Cell f2 =IF(VLOOKUP(D2,$A$2:$B$28,2,0)=0,"",1)
This formula in Cell g2 =IF(VLOOKUP(D2,$A$2:$B$28,2,0)=0,"",2)
This formula in Cell f2 =IF(VLOOKUP(D2,$A$2:$B$28,2,0)=0,"",1)
This formula in Cell h2 =IF(VLOOKUP(D2,$A$2:$B$28,2,0)=0,"",3)
Copy the 3 formulas down for each row of data.
 
Upvote 0
This formula in Cell f2 =IF(VLOOKUP(D2,$A$2:$B$28,2,0)=0,"",1)
This formula in Cell g2 =IF(VLOOKUP(D2,$A$2:$B$28,2,0)=0,"",2)
This formula in Cell f2 =IF(VLOOKUP(D2,$A$2:$B$28,2,0)=0,"",1)
This formula in Cell h2 =IF(VLOOKUP(D2,$A$2:$B$28,2,0)=0,"",3)
Copy the 3 formulas down for each row of data.

Thanks so much! that works which is pretty exciting.

However it would be nice if the formula excluded anything from column B that is below 0 and if it cant match the code from column D with column A could the formula input 0 instead of #N/A ?
 
Upvote 0
This formula in Cell f2 =IF(VLOOKUP(D2,$A$2:$B$28,2,0)<=0,"",IF(ISERROR(VLOOKUP(D2,$A$2:$B$28,2,0)),0,1))
This formula in Cell g2 =IF(VLOOKUP(D2,$A$2:$B$28,2,0)<=0,"",IF(ISERROR(VLOOKUP(D2,$A$2:$B$28,2,0)),0,2))
This formula in Cell h2 =IF(VLOOKUP(D2,$A$2:$B$28,2,0)<=0,"",IF(ISERROR(VLOOKUP(D2,$A$2:$B$28,2,0)),0,3))
Copy the 3 formulas down for each row of data.
 
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,794
Members
449,468
Latest member
AGreen17

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