Now that you've pasted the info without the formulas and formatting we can finish it up. Follow these steps to take you
(almost) home:
1) Delete the first blank row of the file in sheet 2 so that "U.S. Senate - Republican Party" is now in cell A1.
(Remember, to delete a row just right click on the row number at the left and select delete).
2) Select columns A through G and turn on the filter. The reason I want you to highlight the entire columns and not
just a chunk of data is that I want to make sure you don't miss out on any records below that you can't see. Look
at the filter options for column A. Uncheck the box next to “Select all” to uncheck everything then go all the way to
the bottom of the list and select just the blanks. You can do this because you know that if there isn't a candidate
name or party listed in column A, we now no longer need that row's information. With the filter on, delete all of the
rows that are blank in column A. Next, turn the filter off. That should leave you with 705 rows of information.
3) Turn the filters back on. Look under the column A filter again. This time uncheck everything except for
“Candidate’s Name.” This is our header information that is repeated over and over again. Delete the header
information for every row except the first one so that at the end you’re left with labels for your columns. We’ll deal
with the party and office information in Step 7.
4) But first, notice that column C is completely blank. Double check this with a filter just to make sure there aren’t
some records you can’t see. There aren’t, so you can delete that column. This should leave you with data in
columns A through F and 434 total rows of data.
Step 7: Add office and party information for each candidate
The last thing you need to do is add the party and office information for each candidate so we make sure we keep the
proper details with each candidate. Just like you did before, look at the patterns.
What jumped out at me is the fact that when a party/office is listed columns B, C and D are always blank. See Figure 8
where I’ve highlighted rows with this information for you to better see the patterns.
Figure 8
You’ll use this pattern to write one last IF statement to add the data for all of the candidates.
Label cell G2 as something like "Party_Office".
Our first office/party information, "U.S. Senate - Republican Party,” is listed in cell A1. To make things a bit easier, copy
that and paste it into cell G3 which is the record for Sam Clovis.
Now is where the patterns come in. We know that for the next record, row 4, that if cell B4 is blank, then A4 is the party
information for that candidate and others until we reach another “blank” in column B. If B4 is filled in, we can assume that
we’ve moved on to the next office/party and that he candidate's party is the same party as the record above.