Tuesday 15 April 2014

loops - Using Excel to conditionally concatenate multiple rows -


I have a large data file that has some broken rows from the withdrawal process, I'm trying to clean it in Excel I am running into a problem with many lines of investigation. If I can nest a certain amount of statements in my formula, but it runs the risk of missing values. A sample of the data looks like this (the string is pasted in column A):

  'id_ value', 'last_name', 'first_name', '', 'dob', 'gender 'Comment tags comment comment,' id_ value ',' last_name ',' first_name ',' ',' dob ',' gender 'comment' 'id_ value', 'last_name', 'first_name', '', 'dob', ' I would like to have the lines of the comments before them. I would like to comment on the 'Id_Value', 'last_name', 'first_name', '', 'dob', 'gender' comment comment comment comment ''   

Normal line Currently I can identify all the rows and I can work even when it has two commentary rows, but I am going out of the way that I am in loss. Formula: = (IF (B2 = "Flag", IF (B1 = "Flag", "Move") = IF (LEFT (A1, Column C in Formula: =

  ))) Formula in column D: = 1) = "'", "IGNORE", "flag" IF (b2 = "flag", IF (B1 = "flag", IF (C2 = "move" CONCATENATE (A1, A2)))   

Any recommendations are highly appreciated IF

Here you go, download a spreadsheet here.

Paste your data into sheet 1 cell A1 and click on the Run_Filter button. In the pickup, you can first run it with dummy data which is already present in Sheet1 and check to see that the results work.

Some alerts

  1. The macro will be closed when it encounters an empty cell in column A. In this way, I determine that the macro should end.
  2. Comments should not be any longer than 5 comas Otherwise, explain them as real data Be.
  3. a space character in comments is added.
  4. The first line should not contain any comments.

    A new worksheet named Filter Filter will be created with the necessary result.


    If you want to see the code, click on the Developer tab, if it does not exist then click on the macro button  Macro Button Click the Edit button on the macro combination to see the code. edit button

    Give it a try and tell me how it goes Peter H

No comments:

Post a Comment