Help - VB Code for excel QTY Sum

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jball
    New Member
    • Oct 2007
    • 9

    Help - VB Code for excel QTY Sum

    I am working in excel and I am new to visual basic, but I think there is a simple code for my problem.

    In column "J" I have Part Number
    In column "N" I have QTY

    In column "Q" I have an "=if(mid)" statement that displays Part number for only the first part number in column "J" where the part number is different from the previous part number. this column is sorted.

    In column "R" I have a sum of QTY (column "N") for the corresponding Part Numbers.

    Can someone help me with code that will sum the QTY of column "N" while column "Q" is blank (but also including that first base part)

    Maybe a macro is necessary?

    thank you
  • Wolfling
    New Member
    • Nov 2007
    • 9

    #2
    First reply to this forum, so pardon if I mess up the formatting.

    Usually, in this situation, I would introduce an additional column, and then hide it. So.... add a new column (for argument sake, I'll call it column O). Every cell in the column can have a formula like:

    Code:
    =If($N2 = "", $O1 + 1, 0)
    That way, you'll have a column with a running tally of each part number. From there, it should be pretty easy to nail the cells you want.

    Comment

    • jball
      New Member
      • Oct 2007
      • 9

      #3
      Sorry, but that does not seem to work.
      N2 always has a QTY.
      I changed "N" to "Q" because that number shows only when the part number changes, but when I include the rest of the formula, I get that QTY +1, not QTY + QTY from the row above. Maybe I do not understand something...
      Anymore help is appreciated.
      Thank you,

      Comment

      Working...