+ Reply to Thread
Results 1 to 5 of 5

Loop through values in one column and extract values from another?

  1. #1
    Registered User
    Join Date
    12-23-2014
    Location
    California
    MS-Off Ver
    10
    Posts
    4

    Loop through values in one column and extract values from another?

    I'm new to the forum, but I've been struggling with this for a few weeks now and need some help...

    Excel Example.png

    Above is a small sample of the data I'm working with. Basically, what I want to do is loop through the values in column B. Whenever the value changes (in this instance, from 8088 to 8630), I want to take the values in column D and G (in the same row) as 8088 and place them in another worksheet.

    Is this possible? If so, what is the best approach to accomplish it?

  2. #2
    Registered User
    Join Date
    03-26-2014
    Location
    Canada
    MS-Off Ver
    Excel2010
    Posts
    3

    Re: Loop through values in one column and extract values from another?

    Hello Sarah07282;

    I'd like to get some clarification on what you're asking; Are you saying you want to 1. look through columb B and 2. anytime, for instance, B1 is not equal to B2 you want to display what's in D1 and G1 and display it in i. another worksheet or ii. another workbook? Thanks

  3. #3
    Registered User
    Join Date
    12-23-2014
    Location
    California
    MS-Off Ver
    10
    Posts
    4

    Re: Loop through values in one column and extract values from another?

    Another worksheet would be good, but another workbook is fine as well.

    And yes, look through column B, and anytime B1 is not equal to B2, look at D1 and G1.

  4. #4
    Registered User
    Join Date
    03-26-2014
    Location
    Canada
    MS-Off Ver
    Excel2010
    Posts
    3

    Re: Loop through values in one column and extract values from another?

    This formula should work. =IF(B1<>B2,D1&" "&G1,"")
    You can drag it it down using the crosshare and it will autofill from top to bottom. Let me know how it goes. I'm assuming you want the info from D1 and G1 in one cell with a space in between. If not, let me know.

    Jesse1983

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,414

    Re: Loop through values in one column and extract values from another?

    If you want code:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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] Extract values (row values and column values) with formula
    By bjnockle in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 08-17-2014, 10:13 AM
  2. [SOLVED] Macro to loop through cell values in a column and format multiple cell values
    By Roop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2012, 05:39 PM
  3. Extract values in each column
    By JieJenn in forum Excel General
    Replies: 2
    Last Post: 12-21-2011, 04:58 PM
  4. Macro Loop to Extract Specific Values and Min/Max Values From Column/Rows Range
    By ExcelQuestFL in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-19-2010, 09:19 AM
  5. Loop thru lines of text in a cell and extract specific values: please help?
    By Mslady in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2006, 10:22 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