+ Reply to Thread
Results 1 to 6 of 6

Formula to extract values

  1. #1
    Registered User
    Join Date
    04-18-2012
    Location
    Norway, Ålesund
    MS-Off Ver
    Microsoft office 2010/2013
    Posts
    51

    Formula to extract values

    Hey, so what I want to do, is to make a formula in the cells marked with yellow that can find the values posted in sheet2 (The values in sheet 2 will be hard coded). For example, “items” (Test1, test1 etc.) in column B has a corresponding value in column F and for Column C it is corresponding with column G. I want to be able to get the values in sheet2 to sheet1 and be able to them in sheet 1 without gaps between the values (Blank rows).

    TL;DR want to make a formula in sheet1 to get the values in yellow background(Which are from sheet2)
    Attached Files Attached Files
    Last edited by Buster^; 06-20-2014 at 10:27 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,420

    Re: Help with making formula to get values

    Put this formula in D3 of sheet Ark2:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and copy it down as far as you need to (can be beyond the lists that you have in columns B and C). |Then put this formula in C3 of the sheet Ark1:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    then copy this down as far as you need to.

    Then change the value in C2 and see the numbers change accordingly.

    I've set this up in the attached file, so you don't have to worry about translating the function names.

    Hope this helps.

    Pete

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Help with making formula to get values

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Registered User
    Join Date
    04-18-2012
    Location
    Norway, Ålesund
    MS-Off Ver
    Microsoft office 2010/2013
    Posts
    51

    Re: Formula to extract values

    Quote Originally Posted by Pete_UK View Post
    Put this formula in D3 of sheet Ark2:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and copy it down as far as you need to (can be beyond the lists that you have in columns B and C). |Then put this formula in C3 of the sheet Ark1:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    then copy this down as far as you need to.

    Then change the value in C2 and see the numbers change accordingly.

    I've set this up in the attached file, so you don't have to worry about translating the function names.

    Hope this helps.

    Pete
    Thanks, this does work! But let say that I have 20 test values (Test1, test2,... test20). Could I just make 20 hidden columns in sheet2 with formulas:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    And just change the cell reference?

    And in sheet1, could the formula be independent for each test value. So that I can have 20 different test values and each column have different values in them?

    Anyway, thank you for helping me!


    Edit*

    I got it working the way I wanted. Thank you!!
    Last edited by Buster^; 06-20-2014 at 10:26 AM.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,420

    Re: Formula to extract values

    I've moved the formula that was in D3 of the Ark2 sheet to cell I3, and made a few changes so that it now reads:

    =IF($B3='Ark1'!C$2,"1"&"_"&COUNTIF(I$2:I2,"*_*")+1,IF($C3='Ark1'!C$2,"2"&"_"&COUNTIF(I$2:I2,"*_*")+1,"-"))

    This can now be copied across and down into consecutive cells as required - the hyphens help to show where the formula is active. I've also put this formula in I2:

    ='Ark1'!C2

    which is copied across and helps to show what your comparison is.

    Then in C3 of the Ark1 sheet I have changed the formula to this:

    =IF(ISNA(MATCH("*_"&ROWS($1:1),'Ark2'!I:I,0)),"",INDEX('Ark2'!$F:$G,MATCH("*_"&ROWS($1:1),'Ark2'!I:I,0),LEFT(INDEX('Ark2'!I:I,MATCH("*_"&ROWS($1:1),'Ark2'!I:I,0)))))

    and again this can be copied across and down as required. You can put different test values in row 2, and the values in the yellow cells will automatically adjust - copy the formulae further to the right in both sheets if you need to have up to 20 tests (I've just set it up for 6).

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    04-18-2012
    Location
    Norway, Ålesund
    MS-Off Ver
    Microsoft office 2010/2013
    Posts
    51

    Re: Formula to extract values

    Thank you!

+ 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. Need help making a macro to copy range of values based on cell values.
    By zolton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-23-2013, 08:58 AM
  2. Making negative values equal 0
    By resdin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-04-2012, 05:03 PM
  3. Formula for Ignore Hide Values while making SUM ?
    By VICTOR5 in forum Excel General
    Replies: 3
    Last Post: 09-27-2011, 08:34 AM
  4. Making cell values correspond with Drop down List values
    By jrcream in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2008, 03:14 AM
  5. making hidden values appear
    By lonk61524 in forum Excel General
    Replies: 8
    Last Post: 09-17-2007, 08:05 PM

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