+ Reply to Thread
Results 1 to 17 of 17

Inventory count

  1. #1
    Forum Contributor
    Join Date
    07-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013/2016
    Posts
    107

    Inventory count

    Ok let me see if I can explain this one. :D

    I've got these inventory numbers that I've been working with.

    Last years Usage and this years usage combined per warehouse for each item.

    Plus another sheet that has On-Hand counts per warehouse for each item.

    What I'm trying to do is pull my usage count per item per warehouse and place it all on different sheets so that I can compare numbers and do a few different things.

    On my data sheet I have the warehouse number, in my example, "TOT.", 0100, and 0101. In the next column is the item # and on the end is the total used for that item by that warehouse.

    On my the individual warehouse sheets I have the warehouse number, and the item # and some other things.

    What I need is someone to look for the warehouse name "TOT.", 0100, or 0101 and then find the Item # and get the total used from the total column. If it wasn't used or does exist then I need 0 to appear.

    Anyone know how to do this or follow me?

    See attached file.
    Attached Files Attached Files
    Last edited by fasterthanyours; 07-28-2009 at 03:17 PM.

  2. #2
    Forum Contributor
    Join Date
    07-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013/2016
    Posts
    107

    re: Inventory count

    ok so I figured this much out to go in the Used Column.

    =INDEX('Usage Data'!L2:L56, MATCH($A$1 & B3, INDEX('Usage Data'!A2:A56 & 'Usage Data'!B2:B56, 0), 0))

    The only thing is, when the $A$1 & B3 don't exist on the Usage Data sheet, I get "N/A" I need that to be "0".

  3. #3
    Forum Contributor
    Join Date
    07-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013/2016
    Posts
    107

    re: Inventory count

    Update, still have the same problem.

    New problem the 23000+ items in Inventory are taking WAAAAAAAAY to long to calculate.

    Probably going to make each Warehouse it's own workbook.

    Still need help with the ="0"
    Last edited by fasterthanyours; 07-24-2009 at 11:05 AM.

  4. #4
    Forum Contributor
    Join Date
    07-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013/2016
    Posts
    107

    Re: Inventory count

    Anyone have any ideas on this?

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Inventory count

    IFERROR explanation http://www.excelforum.com/excel-new-...matting.html#3


    Please Login or Register  to view this content.
    Usage:
    =IFERROR(INDEX('Usage Data'!L2:L56, MATCH($A$1 & B3, INDEX('Usage Data'!A2:A56 & 'Usage Data'!B2:B56, 0), 0)),0)
    ========

    How to install the User Defined Function:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save your sheet

    The function is installed and ready to use.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Forum Contributor
    Join Date
    07-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013/2016
    Posts
    107

    Re: Inventory count

    Ok I think I finally got it. WOW Your post help.

    I'm having to issues right now. I created a Validation List of all of the Warehouse #'s.
    What I'd like to do is populate that list from the Usage Data sheet Column A. Is that possible?

    Another thing is that I made a macro that sorts my percentage column. I'd like to have the macro sort the percentage column, then the Onhand column, and then the Used column. Or maybe just the percentage and the Onhand. I've recorded macros that do this, but every time I tie it into the Validation List change or I click the button I made, it errors out: (the highlight line)

    Sub Sorting_By_Percent_Then_By_Onhand_Then_By_Used()
    '
    ' Sorting_By_Percent_Then_By_Onhand_Then_By_Used Macro
    '

    ActiveCell.Offset(0, -7).Range("A:H").Select
    ActiveCell.Activate
    ActiveWorkbook.Worksheets("Inventory").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("Inventory").Sort.SortFields.Add Key:=ActiveCell. _
    Range("A1:A928"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
    :=xlSortNormal
    ActiveWorkbook.Worksheets("Inventory").Sort.SortFields.Add Key:=ActiveCell. _
    Offset(0, -2).Range("A1:A928"), SortOn:=xlSortOnValues, Order:=xlDescending _
    , DataOption:=xlSortNormal
    ActiveWorkbook.Worksheets("Inventory").Sort.SortFields.Add Key:=ActiveCell. _
    Offset(0, -1).Range("A1:A928"), SortOn:=xlSortOnValues, Order:=xlDescending _
    , DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Inventory").Sort
    .SetRange ActiveCell.Offset(-1, -7).Range("A1:H929")
    .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    End Sub

    My macro that works is very simple:
    Sub Sorting_by_percentage()
    '
    ' Sorting_by_percentage Macro
    ' Sorting by Percentage
    '

    '
    Range("A2:H930").Select
    Range("H2").Activate
    ActiveWorkbook.Worksheets("Inventory").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("Inventory").Sort.SortFields.Add Key:=Range("H3:H930"), _
    SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Inventory").Sort
    .SetRange Range("A2:H930")
    .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    End Sub




    Anyway, some help with a macro that will sort 2 columns would be cool? Thanks.

  7. #7
    Forum Contributor
    Join Date
    07-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013/2016
    Posts
    107

    Re: Inventory count

    Ok I figured out the Multiple Sorting Marco I wanted by searching another post on the site. I love this place!

    I have a Validation List on the top of my sheet that when modified it runs this script:
    Please Login or Register  to view this content.
    The is as follows:
    Sort Ascending Column H at the header in Row 2 (Percentage)
    Sort Descending Column F at the header in Row 2 (Onhand)
    Sort Descending Column G at the header in Row 2 (Used)

    I also set up some conditional formatting on my Percentage column that helps me determine under used parts.

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Inventory count

    Looks good. Well done.

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

  9. #9
    Forum Contributor
    Join Date
    07-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013/2016
    Posts
    107

    Re: Inventory count

    Quote Originally Posted by JBeaucaire View Post
    IFERROR explanation http://www.excelforum.com/excel-new-...matting.html#3


    Please Login or Register  to view this content.
    Is there anyway to use that IFERROR function in 2003?

    My Boss has 2003 so it doesn't work on his PC. I downgraded to 03 to try and get it working again.

    Here's how it looks now in Excel 2003
    Please Login or Register  to view this content.
    and the other Column
    Please Login or Register  to view this content.

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Inventory count

    Post #5 above explains how to install IFERROR into an Excel 2003 sheet. Follow those instructions, the code is given above, too.

    Then you'll have to edit those formulas above to remove the _xlfn. part so it reads normally again.

  11. #11
    Forum Contributor
    Join Date
    07-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013/2016
    Posts
    107

    Re: Inventory count

    Quote Originally Posted by JBeaucaire View Post
    Post #5 above explains how to install IFERROR into an Excel 2003 sheet. Follow those instructions, the code is given above, too.

    Then you'll have to edit those formulas above to remove the _xlfn. part so it reads normally again.
    I could have sworn that IFERROR thing was there when I check the 2003 version GRRR. I'll check again and see. Thanks.

    Thought it was only for 07, "IFERROR FUNCTION FROM Excel 2007" means this is how you do it in 2003.

  12. #12
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Inventory count

    My bad, that comment in the code is a little oblique, isn't it? IFERROR is a builtin function in 2007, so no UDF is needed. You can simply use the formula I gave you.

    To use IFERROR in 2003 or earlier, the UDF is required and must be installed in your worksheet.

  13. #13
    Forum Contributor
    Join Date
    07-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013/2016
    Posts
    107

    Re: Inventory count

    So I need to put this in the VB Code of the sheet and then use the =IFERROR formula in each cell?

    Please Login or Register  to view this content.
    Usage:
    =IFERROR(INDEX('Usage Data'!L2:L56, MATCH($A$1 & B3, INDEX('Usage Data'!A2:A56 & 'Usage Data'!B2:B56, 0), 0)),0)

  14. #14
    Forum Contributor
    Join Date
    07-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013/2016
    Posts
    107

    Re: Inventory count

    Ok so I verified the VB Code this morning and the formulas.

    Looks like I have everything correct. I have a Module for the IFERROR Function and I changed all of the =_xlfn.IFERROR to =IFERROR.

    It's still not working correctly. I did a sample of the data that I'm dealing with. Date for Item # 1543 exists in all 3 Warehouse, as well as 1542 exists in 2 of them.

    See attached.
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    07-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013/2016
    Posts
    107

    Re: Inventory count

    Ok from doing a little searching I found out that I think I should be using the IF(ISERROR formula, maybe?

    So here's the formula I came up with, but even though the data is in the Onhand sheet, it's not putting it in the Cell.

    =IF(ISERROR(INDEX(Onhand!$D:$D,MATCH($C$1&A9,INDEX(Onhand!$A:$A&Onhand!$B:$B,0),0))),0,(INDEX(Onhand!$D:$D,MATCH($C$1&A9,INDEX(Onhand!$A:$A&Onhand!$B:$B,0),0))))

  16. #16
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Inventory count

    Your data set is pretty large, so I'd be wary of creating HUGE arrays for evaluation, like concatenating to two columns together OVER AND OVER again in cell after cell.

    Best to go ahead and just do it once in the data itself so Excel doesn't have to work that hard.

    I would create KEY column in the ON-HAND that creates the unique values for you.
    =A2&"-"&B2
    ....copied down.

    A similar key in column N on Usage Data and you're ready to go.

    Then in Inventory!F3 use this and copy down:
    =IFERROR(INDEX(Onhand!$D:$D, MATCH($C$1 & "-" & A3, INDEX(Onhand!$G:$G, 0), 0)),0)

    In G3 and copied down:
    =IFERROR(INDEX('Usage Data'!$L:$L, MATCH($C$1 & "-" & A3, 'Usage Data'!$N:$N, 0)),0)
    Attached Files Attached Files

  17. #17
    Forum Contributor
    Join Date
    07-17-2009
    Location
    Raleigh, NC
    MS-Off Ver
    Excel 2013/2016
    Posts
    107

    Re: Inventory count

    Ok sort of solved now. Things work a lot better when the syntax is correct :D

    I'm going to open another Thread for an additional issue.

    http://www.excelforum.com/excel-gene...ml#post2135701

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1