+ Reply to Thread
Results 1 to 3 of 3

excel vba to merge data base on criteria and countif with left function

  1. #1
    Registered User
    Join Date
    02-12-2019
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    1

    excel vba to merge data base on criteria and countif with left function

    StartTime Code Location 1 Location 2 Location 3 Location 4 Location 5
    6:56 AM PP-001 122254_1_0 120609_3_0 120759_0_0 120944_1_2 121218_0_0
    7:29 AM PP-001 122254_1_0 122514_2_0 122555_0_0 122633_0_0 122826_0_0 Sheet1
    9:35 AM PP-002 124440_0_0 124401_4_2 124401_4_2 124401_4_2 125509_0_0
    11:30 AM PP-003 130751_0_0 131148_2_0 131505_0_0 131640_2_1 131916_0_0
    1:12 PM PP-003 132421_0_0 132722_5_0 132933_3_0 133142_1_0 133440_0_0


    StartTime Code Location 3 Location 4 Location 5
    11:56 AM PP-002 123213_1_0 123448_0_0 123546_1_1
    2:23 AM PP-001 124401_4_2 124401_4_2 124401_4_2 Sheet2
    4:22 AM PP-003 131308_2_0 131308_2_0 131308_2_0
    11:30 AM PP-001 133206_0_0 133206_0_0 133206_0_0
    1:12 PM PP-004 135238_0_3 135405_0_0 135444_1_2


    StartTime Code Location 2 Location 3
    3:13 AM PP-001 125022_0_0 125043_0_0
    5:22 AM PP-002 131940_0_0 132008_0_0 Sheet3
    8:12 AM PP-003 133949_0_0 133949_0_0



    StartTime Code Location 1 Location 2 Location 3 Location 4 Location 5
    6:56 AM PP-001 123254_1_0 120609_3_0 120759_0_0 120944_1_2 121218_0_0
    7:29 AM PP-001 122254_1_0 122514_2_0 122555_0_0 122633_0_0 122826_0_0
    9:35 AM PP-002 124440_0_0 124401_4_2 124401_4_2 124401_4_2 125509_0_0
    11:56 AM PP-002 123213_1_0 123448_0_0 123546_1_1 Cosolidated
    2:23 AM PP-001 124401_4_2 124401_4_2 124401_4_2
    11:30 AM PP-001 133206_0_0 133206_0_0 133206_0_0
    3:13 AM PP-001 125022_0_0 125043_0_0
    5:22 AM PP-002 131940_0_0 132008_0_0


    How to Use VBA or power query to merge from Sheet 1, Sheet2 and Sheet 3 into 1 New Sheet (cosolidated) Only For Code PP-001 and PP-002 as shown

    How to check Duplicate Record for Only selected the first 4 Character (For example 12514_2_0 and 12512_3_1 is consider Duplicate


    I try ro use COUNTIF($C25:$G25;LEFT(C25,4))>1 But Not working

    Countif(range,left(Text,4)>1 not working ???
    Attached Images Attached Images

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: excel vba to merge data base on criteria and countif with left function

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: excel vba to merge data base on criteria and countif with left function

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)

+ 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] Using left Function to extract data based on several Criteria
    By Howardc1001 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-07-2019, 11:38 AM
  2. [SOLVED] COUNTIF when a criteria is a formula RIGHT(LEFT
    By bond002 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-12-2014, 05:28 PM
  3. Countif If with 2 Criteria but with Left function in one!!
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2007, 05:22 AM
  4. Replies: 3
    Last Post: 07-07-2006, 04:10 PM
  5. Excel COUNTIF Function - a range as criteria ?
    By joes in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-06-2006, 09:15 AM
  6. [SOLVED] Excel function to countif a criteria is matced within to columns
    By =countif(data!A:A,"001",andif (data!B:B, in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  7. [SOLVED] Excel function to countif a criteria is matced within to columns
    By =countif(data!A:A,"001",andif (data!B:B, in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 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