Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

report format indentations

Posted on 2013-11-11
2
Medium Priority
?
186 Views
Last Modified: 2013-11-19
I have received a word document in format

group 1
  member 1
  member 2
  member 3
group 2
  member 1
  member 2
  memeber 3

Its proving hard to do analysis, I would like to autofilter for say all members of group 1. Is there anyway to import this data into excel so it would be like

group    members
--------------------------
1             member 1
1             member 2
1             member 3
2             member 1
2             member 2
2             member 3

I cant see how on earth to format it in this way. From what i can see the indent is 3 characters.
0
Comment
Question by:pma111
2 Comments
 
LVL 35

Accepted Solution

by:
mvidas earned 1000 total points
ID: 39638734
Hi pma,

What you can do is test for the space, and then split up the cells into columns based on the spacing. The same formulas can tell you which rows are "bad" data, so you can sort based on them later and then delete them. I'll paste a sample workbook.

Copy/paste your data into excel, starting in A2.
In B2, enter the following: =IF(LEFT(A2,1)=" ",B1,A2)
In C2, enter the following: =IF(LEFT(A2,1)=" ",TRIM(A2),"#DELETE")
In D2, enter the following: =C2="#DELETE"

Then fill down B:D through the end of your data. Copy/paste values, and then sort by column D to delete the "bad" rows.

Take a look at the attachment, let me know if you have any other questions or are having trouble fitting it to your data.

Matt

EDIT: I forgot to add, you'll delete column A when you're done too, leaving only the original B:C columns (or whatever you need if your data is different)
pma-sample.xlsx
0
 
LVL 34

Assisted Solution

by:Rob Henson
Rob Henson earned 1000 total points
ID: 39638739
Assuming data in A2 to A9, enter the following in an adjacent column, I have put in columnn C:

=IF(LEFT(A2,5)="Group",A2,C1)

Copy down the extent of the data.

This says "If the data is a group header use it otherwise use previous row"

This column of formulas should then be copied and pasted as values. You will then have the group header against each user. The original group header rows can then be deleted. If you want rid of the word group in this column use Edit Replace; search for "Group ", replace with "". Alternatively, this function can be written into the formula:

=IF(LEFT(A2,5)="Group",RIGHT(A2,LEN(A2)-5)*1,C1)

Thanks
Rob H


Thanks
Rob H
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question