Sorting to include col 1 text while sorting according to col 4

JennyReed

New Member
Joined
Feb 8, 2011
Messages
23
Hi.
I have a table of data something like:

Taxon Species Index No. individuals
taxon1 species1 35.63 15

taxon2 species2 28.22 7

taxon3 species3 25.94
species4 28.52 6
species5 21.35
species6 26.64 18

taxon4 species7 22.94 26

I would like to generate a table according to No. Individuals where all the blanks are excluded - i.e. only the rows with data in are included. At the same time, I would like the taxon name to included in the final table. With the data above, if I filter according to No. Individuals to exclude blanks, I would generate a table that looks like:

taxon1 species1 35.63 15
taxon2 species2 28.22 7
species4 28.52 6
species6 26.64 18
taxon4 species7 22.94 26
In other words, the third and fourth rows in the 'filtered' table do not have the taxon3 name.

I would like the table to look like:
taxon1 species1 35.63 15
taxon2 species2 28.22 7
taxon3 species4 28.52 6
species6 26.64 18
taxon4 species7 22.94 26

I know that I can copy the taxon name for every row of data but I am hoping to avoid this as I would like the taxon name to appear only once in column 1. I am hoping to avoid the table looking like:

taxon1 species1 35.63 15
taxon2 species2 28.22 7
taxon3 species4 28.52 6
taxon3 species6 26.64 18
taxon4 species7 22.94 26
Where 'taxon3' is repeated twice.

Any help would be greatly appreciated.
Jenny

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
 
Hi Peter

Thank you very much. That works.
You were completely correct, I was not after the rows that you had marked in blue.
Sorry about that.

Kind regards,
Jenny
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi Peter

I have one adjustment for the output table: the taxon name (col A) to be listed in the table for the first occurrence of an 'art':
For example, for the data:
TAXON NAMES
ArtISI 2012NSI 2013# G1# G2#G3#G4#G5#G6

Phylum FORAMINIFERAForaminifera indet
Phylum PORIFERAPorifera indet23.4935.63
Class ANTHOZOAAnthozoa indet8.0928.22 4
Class HYDROZOA (phylum Cnidaria)Hydrozoa indet10.0925.92 5
Subclass OCTOCORALLIA (phylum Cnidaria)Alcyonium digitatum
Anthelia fallax 6
Anthomastus grandiflorus 1
Anthothela grandiflora
Subclass HEXACORALLIA (phylum Cnidaria)Actinauge richardi
Actiniaria indet18.9832.17 2
Actinia equina

<colgroup><col style="mso-width-source:userset;mso-width-alt:7460;width:153pt" width="204"> <col style="mso-width-source:userset;mso-width-alt:6619;width:136pt" width="181"> <col style="mso-width-source:userset;mso-width-alt:1316;width:27pt" width="36"> <col style="mso-width-source:userset;mso-width-alt:1462;width:30pt" width="40"> <col style="mso-width-source:userset;mso-width-alt:877;width:18pt" width="24"> <col style="mso-width-source:userset;mso-width-alt:950;width:20pt" width="26"> <col style="mso-width-source:userset;mso-width-alt:877; width:18pt" span="2" width="24"> <col style="mso-width-source:userset;mso-width-alt:841;width:17pt" width="23"> <col style="mso-width-source:userset;mso-width-alt:877;width:18pt" width="24"> </colgroup><tbody>
</tbody>















































The output table with the current formulas looks like:

TAXON NAMES
ArtISI 2012NSI 2013#G1#G2#G3#G4#G5#G6
Class ANTHOZOAAnthozoa indet8.0928.22 4
Class HYDROZOA (phylum Cnidaria)Hydrozoa indet10.0925.92 5
Anthelia fallax 6
Anthomastus grandiflorus 1
Actiniaria indet18.9832.17 2

<colgroup><col style="mso-width-source:userset;mso-width-alt:6290;width:129pt" width="172"> <col style="mso-width-source:userset;mso-width-alt:3840;width:79pt" width="105"> <col style="mso-width-source:userset;mso-width-alt:1682;width:35pt" width="46"> <col style="mso-width-source:userset;mso-width-alt:1828;width:38pt" width="50"> <col style="mso-width-source:userset;mso-width-alt:1097;width:23pt" width="30"> <col style="mso-width-source:userset;mso-width-alt:1170;width:24pt" width="32"> <col style="mso-width-source:userset;mso-width-alt:1060; width:22pt" span="2" width="29"> <col style="mso-width-source:userset;mso-width-alt:1024;width:21pt" width="28"> <col style="mso-width-source:userset;mso-width-alt:1060;width:22pt" width="29"> </colgroup><tbody>
</tbody>





















Whereas, I would like it to look like:

TAXON NAMES
ArtISI 2012NSI 2013#G1#G2#G3#G4#G5#G6
Class ANTHOZOAAnthozoa indet8.0928.22 4
Class HYDROZOA (phylum Cnidaria)Hydrozoa indet10.0925.92 5
Subclass OCTOCORALLIA (phylum Cnidaria)Anthelia fallax 6
Anthomastus grandiflorus 1
Subclass HEXACORALLIA (phylum Cnidaria)Actiniaria indet18.9832.17 2

<colgroup><col><col><col><col><col><col><col span="2"><col><col></colgroup><tbody>
</tbody>



Thank you in advance.
Kind regards,
Jenny
 
Upvote 0
Not entirely sure but try this.

Formula in L1 is a stand-alone formula (just moved from M1 in my previous layout)
M1 houses a 0
L2:N2 copied down
O2 copied across and down.

Excel Workbook
ABCDEFGHIJKLMNOPQRSTUVW
1TAXON NAMESArtISI 2012NSI 2013# G1# G2#G3#G4#G5#G650TAXON NAMEArtISI 2012NSI 2013# G1# G2#G3#G4#G5#G6
2 6Class ANTHOZOAAnthozoa indet8.0928.224
3Phylum FORAMINIFERAForaminifera indet8Class HYDROZOA (phylum Cnidaria)Hydrozoa indet10.0925.925
411Subclass OCTOCORALLIA (phylum Cnidaria)Anthelia fallax6
5Phylum PORIFERAPorifera indet23.4935.6312Anthomastus grandiflorus1
616Subclass HEXACORALLIA (phylum Cnidaria)Actiniaria indet18.9832.172
7Class ANTHOZOAAnthozoa indet8.0928.2246
8
9Class HYDROZOA (phylum Cnidaria)Hydrozoa indet10.0925.9258
10
11Subclass OCTOCORALLIA (phylum Cnidaria)Alcyonium digitatum
12Anthelia fallax611
13Anthomastus grandiflorus112
14Anthothela grandiflora
15
16Subclass HEXACORALLIA (phylum Cnidaria)Actinauge richardi
17Actiniaria indet18.9832.17216
18Actinia equina
JennyReed 4
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,665
Members
449,091
Latest member
peppernaut

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