+ Reply to Thread
Results 1 to 3 of 3

Get instance of value in column

  1. #1
    Registered User
    Join Date
    10-03-2013
    Location
    Michigan, USA
    MS-Off Ver
    O365 Insider (Beta Channel)
    Posts
    8

    Get instance of value in column

    Hello,

    I've an Excel file with the structure shown in below image (also in the attached Excel)

    Basically this sheet is status report for testing samples.

    There is Test Plan Number, Order of Test in the Test Plan, Sample Number and a unique identifier and some other columns with unique stuff. (I cannot use Remove Duplicates and I don't want to delete unique columns).

    What I'm trying to do is without messing up the first few columns (no deleting), either with VBA or a formula that will just like in Column D that I wrote, will count the number of Samples from the row entries, then record that number in the 1st instance and delete the rest of the corresponding rows.

    Obviously if it's an array function or something, it cannot delete, but VBA could. if Function I'd like the Column G to represent which instance of the test it is. I will then filter out if it's greater than 1. Again this 1st instance needs to work out how many total samples there is and record that in adjacent column.

    Ow and each Plan can have same Order Number and Same Samples, hence why I'm using both 3 columns to differentiate the # of Samples. Data is not sorted, though it can be if it helps with the code..

    Perhaps being Friday 5PM, I couldn't figure out where to start. I'm thinking of a slow way going through each cell with VBA and work out the details, but I feel there are better ways.

    I just need some pointers. For sure it'd be great if someone could share a code , but looking for ideas for the moment.

    Thanks!

    ps. was there an Enhanced Interface - Full WYSIWYG Editing ? I feel like it'd help out with formatting....
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Get instance of value in column

    Perhaps

    =IF(COUNTIFS(A$1:A1,A2,B$1:B1,B2,C$1:C1,C2),"",COUNTIFS(Plan,A2,Order,B2,Sample,C2))

    Copy & pastespecial > values, then delete the blanks?

  3. #3
    Registered User
    Join Date
    10-03-2013
    Location
    Michigan, USA
    MS-Off Ver
    O365 Insider (Beta Channel)
    Posts
    8

    Re: Get instance of value in column

    damn! Glad I asked. As I said I was looking at complicated solutions or slow array formulas at the moment.
    This works perfectly. Thank you Jason!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA code to select row for 2nd nth instance of a value in a column
    By lsargent in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2016, 03:57 PM
  2. VLOOKUP for the X instance of a value in a column
    By Nate Westcott in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-10-2015, 06:04 PM
  3. Replies: 3
    Last Post: 07-15-2014, 09:50 AM
  4. Search table column for 1st instance of a value
    By okmred in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2013, 02:17 PM
  5. Number Each Instance in Corresponding Column
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2013, 02:21 PM
  6. First Instance of a Value in a Column
    By Roccobarocco in forum Excel General
    Replies: 2
    Last Post: 07-11-2009, 07:26 AM
  7. Only need first instance of SUMIF in a column
    By Lizabeta in forum Excel General
    Replies: 5
    Last Post: 04-22-2009, 11:42 AM

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