Extracting entries for column headers

kyle_04

Board Regular
Joined
Sep 26, 2009
Messages
68
Hi,

I am trying to create a summary sheet that does not require any manual inputting. The problem I have is with the column headers linked to the formulas. Instead of having to manual input these I would like to extract them from an array in another sheet.

So, is it possible to extract the first entry in the array, then the second, and then the third, and so on. and will these be displayed in alphabetical order or whenever the first entry is found? Ignoring duplicate entries of course.

So for example I need the formula for the summary column header in A1, b1, c1, (and so on) extracting data from sheet2!A:A with entries such as:

Kyle
John
Smith


Your help would be much appreciated,

Kyle
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
The description is a bit vague but if Kyle, John, Smith is in A1:A3 of Sheet 2 and you want those in A1:C1 of another sheet, then in the other sheet ..
A1: =INDEX(Sheet2!$A:$A,COLUMNS($A1:A1))
Then copy this formula acroos to B1, C1 etc
 
Upvote 0
Hi,

Thanks for the reply,

That seems to have worked, but when I apply it to my data zeros show up in the first three columns and some of the entries are duplicated.

Also I need to expand the formula to include data from another column in sheet 2!B:B, which will be last names that need to be displayed on the summary in row 2. Can this be done?

In essence the summary will show:

A B C
1 Kyle John Smith
2 Donnelly Turner Bate




Thanks,

Kyle
 
Upvote 0
This seems a much more complex problem and I doubt easily solved by formulas alone.

For example, you don't want duplicates from column A but since you now say you also want the Last names from column B. So, if the names in columns A:B were ..

John Smith
Ann Jones
John Brown

.. even though John is a duplicate in column A, wouldn't you want that name twice in your final list?

For a manual approach, ensure these columns have headers and look at Advanced Filter to produce a unique list of names. Then look at using that list for your new headers, perhaps using the sort of formula I suggested earlier.

Otherwise a macro could be used to do these tasks.

Post back if you need more help with either method and include what Excel version you are using.
 
Upvote 0
Hi,

I have got round the issue by combining the columns in sheet2,

However it still doesn't explain the zero's and duplicates and there are also some entries missing. I have used the formula over 14 columns and starts like this:

=INDEX(sheet2!$E$10:$E$111,COLUMNS(Summary!$B27:B27))


Do you think it is because there are blanks in the array (sheet2!$E$10:$E$111).

Much appreciated,

Kyle
 
Upvote 0
Hi,

I have just checked and that formula is picking up all the entries with blanks in and showing them as 0, and it is keeping the duplicates in, is there any way round this?


Regards,

Kyle
 
Upvote 0
See if this is any use.

Sheet2
I've used columns J:K as helper columns but any columns could be used.
J1 houses a 0.
Formulas in C2, J2 copied down to the end of your data.
Columns J:K could be hidden.

Excel Workbook
ABCDEFGHIJK
1FirstLastBoth04
2JohnSmithJohn Smith1
3AnnJonesAnn Jones2
4JohnBrownJohn Brown3
5AnnJonesAnn Jones3
6JohnSmithJohn Smith3
7BillSmithBill Smith4
8
Sheet2



Summary sheet.
Formula in A1 copied across.

Excel Workbook
ABCDE
1John SmithAnn JonesJohn BrownBill Smith
Summary
 
Upvote 0

Forum statistics

Threads
1,224,526
Messages
6,179,322
Members
452,906
Latest member
Belthazar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top