Is this a formal Excel Table (ListObject - usually with automatically formatted banded rows) or just three standard columns of data.
Suggestion below assumes a formal table (Table1) but suggestion could be modified if you just have standard columns of data.
My sample dummy data looks like this.
Sheet1
| A | B | C |
| | | |
| | | |
State 2 | County 2 | Text 101 | |
| | | |
State 2 | County 4 | Text 103 | |
| | | |
State 1 | County 6 | Text 105 | |
<colgroup><col style="font-weight:bold; width:30px; "><col style="width:74px;"><col style="width:90px;"><col style="width:69px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]1[/TD]
[TD="bgcolor: #99ccff"]States[/TD]
[TD="bgcolor: #99ccff"]Counties[/TD]
[TD="bgcolor: #99ccff"]Text[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]State 1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]County 1[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]Text 100[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]4[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]State 3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]County 3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]Text 102[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]5[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]6[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]State 2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]County 5[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]Text 104[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]7[/TD]
</tbody>
Excel tables to the web >> Excel Jeanie HTML 4
In the other sheet
Put the state of interest in A1 (or it could be anywhere)
Add headings in B1:C1 as shown
Select B1:C1 and on the Insert ribbon tab choose Table -> My table has headers -> OK
Fill in the formulas as shown and copy them down as far as you might ever need.
State 2
| A | B | C |
State 2 | | | |
| | | |
| County 4 | Text 103 | |
| | | |
| | | |
| | | |
| | | |
| | | |
<colgroup><col style="font-weight:bold; width:30px; "><col style="width:61px;"><col style="width:86px;"><col style="width:69px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]1[/TD]
[TD="bgcolor: #99ccff"]Counties[/TD]
[TD="bgcolor: #99ccff"]Text[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]County 2[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]Text 101[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]4[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]County 5[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "]Text 104[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]5[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]6[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "] [/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "] [/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]7[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]8[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "] [/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=969696]#969696[/URL] "] [/TD]
</tbody>
Spreadsheet Formulas |
Cell | Formula | B2 | =IFERROR(INDEX(Table1[Counties],AGGREGATE(15,6,(ROW(Table1[States])-ROW(Table1[[#Headers],[States]]))/(Table1[States]=A$1),ROWS(INDEX([Counties],1):[@Counties]))),"") | C2 | =IFERROR(INDEX(Table1[Text],AGGREGATE(15,6,(ROW(Table1[States])-ROW(Table1[[#Headers],[States]]))/(Table1[States]=A$1),ROWS(INDEX([Counties],1):[@Counties]))),"") |
<tbody>
</tbody> |
<tbody>
</tbody>
Excel tables to the web >> Excel Jeanie HTML 4
Repeat for other states of interest.