views:

701

answers:

2

So I have a document with many entries that follow this general format.

Organization Name Title Address Phone Fax

Description line 1

Description line 2

Organization's website.

Organization Name Title Address Phone Fax

Description line 1

Description line 2

Organization's website.

Organization Name Title Address Phone Fax

Description line 1

Description line 2

Organization's website.

What I want to do is to sort them by organization and treat the first rows as one entry so excel essentially thinks:

Organization Name Title Address Phone Fax

Description line 1

Description line 2

Organization's website.

is one row. I should also add that the bottom 3 rows are merged across the cells that form the row above them. Essentially I need it to work as a database but for government workers who are so technically unsavvy they can't upgrade to Office 2007 because the whole ribbon thing is "too confusing." So I am stuck using Excel 2002. I need to be able to sort them and use the top few rows above the actual chart to include a header and sub-heading.

+1  A: 

Do you need the description/website rows to remain merged? If not unmerge to make it easier. You've tagged it as VBA but if this is a one-time fix then is it OK to manually work on the sheet?

As a starting point I would suggest adding an identifier to each group of rows, and depending on your data quality you could do this by checking the website cell, or simply by counting rows. For example, you could insert a new column before your data and put the following in cell A2:

=IF(Left(Lower(B1),4)="http",B2,A1)

Where B1 (the row above) could be Organization, Description 1, Description 2, Organization's website, and if it is a website, we assume that on this new row we're starting with a new block of data so we'll take the organization name. If it isn't a website, we'll use the organization name we were using previously (A1 will need to =B1). Then copy that formula down until the end and the 4 rows will at least now have a common key which you can then use to mash around the data.

If there are URLs which just start www. then modify the formula or better, just search/replace "www." to be "http://www." so that your data quality has improved.

Alistair Knock
Would it be better to just do it as a raw number and just call each set of rows 1 then 2 then 3 so that changes to the data wont affect the identifier?
Possibly, particularly if there's likelihood of duplicate organisation names. Start A1=1, then formula =IF(Left(Lower(B1),4)="http",A1+1,A1)
Alistair Knock
A: 

Can't you just try recording a macro daoing whatver sort operation you want using UI, and then alanyze the code, and get an idea of what you need to do?

Adarsha