+ Reply to Thread
Results 1 to 3 of 3

Thread: PivotTable formatting means Vlookup won't work!

  1. #1
    Registered User
    Join Date
    06-27-2008
    Location
    Wakarusa
    Posts
    2

    PivotTable formatting means Vlookup won't work!

    Hey there!

    I'm working on a bill of materials that uses a pivot table to sum all the wire used in a wire harness. To the right of the pivot table are two columns, one to calculate the footage of each wire type from the pivot table's inches, and the other is the part number for the wire. (See picture)

    http://img246.imageshack.us/img246/6...tformatrq7.png

    I am pulling the part numbers from a separate file, our 'Master List', which is formatted like so:

    http://img170.imageshack.us/img170/1...mformatym6.png

    Now, in the Master list, I have no problem making a column that's simply =GA&COLOR and filling it down to reduce the problem to one criteria.

    My problem comes from autofilling a formula down the BOM page. See, due to the formatting of the pivot table, 2GA Red and 4GA BLK have no gauge. Technically, to excel the gauge cells for those are blank. Though to a user it's obvious due to the line formatting on the sheet, to a formula it doesn't work.

    I realize in the picture of the BOM there are part numbers, but in each BOM, the pivot table adjusts, so in some the table is longer, in others it's shorter, and the order of the colors within the gauge is fairly random. Thus fixing the bills when a change is made takes easily 30-45 minutes.

    I've looked at adding the Part Number to the database the pivot table uses, but the wires appear many many numerous times and I have about 1000 of these BOMs.

    So, how can I use a formula to (recursively?) look to the cell above if the guage cell is blank? Is there a different tool I could use?

    Thanks for all your help!!

  2. #2
    Forum Guru mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2007/2010
    Posts
    3,004
    This user defined function may help

    Function NextValueUp(Cell As Range)
    If Cell.Value = "" Then
        NextValueUp = Cell.End(xlUp).Value
    Else
        NextValueUp = Cell.Value
    End If
    End Function
    Paste this into a new module in the VBA editor (Alt F11).

    In the sheet you can use a formula like

    =NextValueUp(A2) & B2
    to get the concatentation that you are after.
    Martin

    Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.

    If my solution has saved you time and/or money, please consider donating to Cancer Research UK.

  3. #3
    Registered User
    Join Date
    06-27-2008
    Location
    Wakarusa
    Posts
    2

    Thank You!

    Works like a charm! Thank you very much, that's exactly what I was looking for.

+ 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.2.0