+ Reply to Thread
Results 1 to 13 of 13

Merging data?

  1. #1
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Merging data?

    This is an interesting one, I suspect you'll need a macro for it but thought I'd try here first.

    Attached is an example, I require the yellow to be filled in by either SILT,SAND or CLAY

    The left table is equipment push start and end depths and the right table is geological start and end depths.

    What I want is the left table (yellow) to be automatically filled in by the information from the table on the right from best fitting the start and end depths. It doesn't have to be exact as the equipment pushes are not based on geology.

    Is this kind of thing even possible?
    Attached Files Attached Files

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Merging data?

    Sounds like you want a LOOKUP formula.

    IN E2 and filled down
    =LOOKUP(C2,$K$7:$N$18)

    However, your ranges need to be adjusted.
    E18 returns SAND instead of SILT because the value is 35.5, which exists in both ranges specified in rows 16 and 17 of the table..

    The END range should not be the same as the Start of the next range...
    ie

    0 - 2.027
    2.027 - 5

    Should be either
    0 - 2.026
    2.027 - 5

    or
    0 - 2.027
    2.028 - 5

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Merging data?

    Maybe this
    Enter in E2 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Re: Merging data?

    Thank you for the reply!

    It almost works, I see what you mean about E18. Is there a way for this formula to detect if one of the "pushes" has a higher percentage of SAND or SILT (or CLAY) and then select that one?

    Thanks again, this will get me started

  5. #5
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Re: Merging data?

    Hi AlKey,

    I only get an error unfortunately when I try this one

  6. #6
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Re: Merging data?

    AlKey,

    Sorry I just needed to more K$7:N$18 to L$7:O$18 and it works! I get the same result as LOOKUP(D2,$K$7:$N$18)

  7. #7
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Re: Merging data?

    Ok What about if there are two locations?

    I've added to the sheet with your solutions but I'm unsure on how to proceed

    Thanks again for your help
    Attached Files Attached Files

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Merging data?

    Try

    =LOOKUP(MAX(C$2:D2),OFFSET($L$7:$O$7,MATCH(A2,$K$7:$K$28,0)-1,0,COUNTIF($K$7:$K$28,A2),))

  9. #9
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Re: Merging data?

    Almost, It works for the first Borehole....But then says it's SAND for everything in Borehole 2

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Merging data?

    Not sure why that $ got put into the range used by MAX, but it should be removed..

    =LOOKUP(MAX(C$2:D2),OFFSET($L$7:$O$7,MATCH(A2,$K$7:$K$28,0)-1,0,COUNTIF($K$7:$K$28,A2),))
    should be
    =LOOKUP(MAX(C2:D2),OFFSET($L$7:$O$7,MATCH(A2,$K$7:$K$28,0)-1,0,COUNTIF($K$7:$K$28,A2),))

  11. #11
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Merging data?

    Not sure I understand why Max is there at all.. Maybe just use D2 (use END instead of the Start that I used at first)

    =LOOKUP(D2,OFFSET($L$7:$O$7,MATCH(A2,$K$7:$K$28,0)-1,0,COUNTIF($K$7:$K$28,A2),))

  12. #12
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    107

    Re: Merging data?

    Thank you,

    I might need a macro to be more precise but this has helped a lot. Thank you for your solutions

  13. #13
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Merging data?

    You're welcome.

+ 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. Replies: 1
    Last Post: 11-02-2017, 09:20 PM
  2. combining company data and merging/summing up data from certain columns
    By bottledwater in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-13-2016, 10:05 AM
  3. Replies: 6
    Last Post: 08-08-2013, 06:50 PM
  4. Replies: 4
    Last Post: 01-16-2013, 10:06 PM
  5. Merging: displaying which sheet data comes from when merging sheets
    By zed commander in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-12-2012, 12:20 PM
  6. Replies: 1
    Last Post: 04-09-2012, 09:21 AM
  7. Merging cells/merging cell content.
    By rhintintin in forum Excel General
    Replies: 3
    Last Post: 09-23-2010, 10:42 AM

Tags for this Thread

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