+ Reply to Thread
Results 1 to 21 of 21

Match 3 values

  1. #1
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Match 3 values

    Hi all,


    On the attached spreadsheet there is a “3G H3” worksheet and a “Location Table” worksheet – plus 2 x “Example” worksheets.

    In the “3G H3” tab there are various columns, most of which have been sanitised. I am looking to get the values after the last / in Column G into the relevant cells in the “Location Table” worksheet based on the following:

    - Where Column B is not blank and shows a location (i.e. A,B,C,D)
    - Where Column J is not blank
    - Then copy the unique values from Col G (after the /) in the correct place on “Location Table” worksheet.

    For example, as shown in the example worksheets – I have highlighted the relevant columns in “Example Data”. I’ve filtered on Location A and filtered to show the non-blanks in Column J.

    For Location A (Column B) in Column G after the last / there are 7 x unique values, that are shown in the “Example Table” worksheet. The data goes into this section as we are interested in Location A, plus the network and technology shown in cell C3, which matches with the values in Column B and C (albeit 3G matches with 3, so the “G” can effectively be ignored”).

    Different sheets with show different values in C3, out of a possible of 11:
    - 2G EE, 2G O2, 2G Voda
    - 3G H3, 3G Voda, 3G O2, 3G EE
    - 4G H3, 4G Voda, 4G O2, 4G EE

    I am looking to loop through all worksheets, to match those unique values after the last / from Column G in sheets(3) onwards – to match what is shown in the “Location Table” which is sheet(2).

    Any ideas?
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Match 3 values

    Not really sure about generation other than 3 though.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Match 3 values

    Fantastic once again Jindon!

    This code will work on any worksheet that starts "3G or "2G"...is there a way to reference that?

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Match 3 values

    If the sheet name starts with a number followed by G and a space.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Match 3 values

    Incredible, that is perfect!

    One final variable. For sheets titled "4G EE" "4G O2" and "4G Voda" the premise is as follows:

    - Non blanks column B (locations) as with above codes
    - Non blanks column K NOT column J with above codes
    - Instead of taking unique values from after the last / in Column G, need to take unique values from Column K itself

    If you understand what I mean?

    Thank you once again

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Match 3 values

    Change to
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Match 3 values

    I've amended the code slightly to extract the relevant data for 4G EE, as this differs the most from other data.

    Currently it looks like this:

    Please Login or Register  to view this content.
    When looking at the number after the last / from the relevant column, this code need to work with the 2nd / and to replace the last / with a 0 or 2 x 0.

    For for example, the data from Column G for 4G EE currently looks like this: LTE 234/30/11858/9

    I am interested in the 11858/9 part, so after the 2nd /.

    However, IF the number at the end is one digit then the / needs to be replaced with 00 and if the number at the end is 2 two digits then the / needs to be replace with 0

    - For example, based on LTE 234/30/11858/9 the number to be extracted to the location table would be 11858009
    - Based on LTE 234/30/10644/14 then the number to be extracted to the location table would be 10644014

    If you understand what I mean?

    Massive thank you once again :-)

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Match 3 values

    You said,
    Quote Originally Posted by chrisellis250 View Post
    One final variable. For sheets titled "4G EE" "4G O2" and "4G Voda" the premise is as follows:

    - Non blanks column B (locations) as with above codes
    - Non blanks column K NOT column J with above codes
    - Instead of taking unique values from after the last / in Column G, need to take unique values from Column K itself
    List all the possible combinations in one post.

  9. #9
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Match 3 values

    Apologies Jindon, that one was for 4G O2, 4G Voda and 4G H3.

    Been a work in progress, so have come across different variables as I've tested code.

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Match 3 values

    Untested, so if this doesn't work, need to see your wokbook with data and the result,

    No many rows, just 10-20 rows will do.

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Match 3 values

    Currently getting a "Run-time error '9': Subscript out of range" error on:

    Please Login or Register  to view this content.
    Any ideas?

    Will sort a test workbook for you, just checking that error with you.

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Match 3 values

    That means C1 hasn't got sheet name.

  13. #13
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Match 3 values

    Thanks Jindon!

    Code works for 3G and other 4G, but get an error on the 4G EE:

    "Run-time error '9': Subscript out of range" error on:

    Please Login or Register  to view this content.
    I've attached a sample.
    Attached Files Attached Files

  14. #14
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Match 3 values

    No more change in sheets?
    Change 2 to 4
    Please Login or Register  to view this content.

  15. #15
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Match 3 values

    Sorry, what do you mean change in sheets?

    Sheets 1 and 2 will always be "Home" and "Location Table" and then there can be anything between 1 and 11 sheets from sheet 3 onwards, which will consist of any combination of 2G Voda, O2, EE then H3, Voda, EE or O2 on 3G or 4G. So the sheet 4G EE could be anything between sheet index 3 or sheet index 13.

  16. #16
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Match 3 values

    Look at the file in your post #1, row 2 is completely blank, but your last file is not.

  17. #17
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Match 3 values

    Row 2 can be ignored, as what is in that row is irrelevant. The bits in yellow have just been put in to show you what values I am looking for.

  18. #18
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Match 3 values

    For you YES, but not for the code!!!

  19. #19
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Match 3 values

    Right ok, apologies. That can be cleared if necessary.

  20. #20
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Match 3 values

    You are the one who should decide.

    If blank on 2nd row, 2 else 4 for starting loop counter.

  21. #21
    Forum Contributor
    Join Date
    03-04-2014
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2019
    Posts
    756

    Re: Match 3 values

    Ok, sorry I understand what you mean. As the files will always have something in there, then row 2 will have some text in it and not be blank.

+ 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] Sort values in ascending order, match each value in cell and pull values to match
    By bjnockle in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-27-2018, 06:21 AM
  2. Replies: 5
    Last Post: 02-26-2017, 04:46 PM
  3. Replies: 5
    Last Post: 02-18-2017, 11:21 AM
  4. Replies: 3
    Last Post: 05-19-2014, 02:01 PM
  5. [SOLVED] VLOOKUP match on first x values or ignore last x values - partial match
    By bobtu in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-17-2014, 10:00 PM
  6. Replies: 6
    Last Post: 01-16-2014, 01:30 PM
  7. Search and Find Match Values and Paste Match Values to a Row
    By jeffheartnet in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-26-2012, 08:34 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