Excel n00b here. I am able to do simple stuff with Excel (simple, meaning stuff most people can’t do, but far less than the experts).
I have been trying different ways to pull data from a sheet that is not well put together (I download periodic reports from the local government, so I have no control over the base Excel file).
The sheet has an identifier column (Plaintiff / Defendant), which then has two empty cells below it (which accounts for the next column). The next column has the name of the party in one cell, then the cell below has their address. The problem is that it is formatted as merged cells, so the address being in one cell is merged with the third cell down. The other problem is that periodically there is a blank row or rows between the entries. Looks like this (sorry for the ugly formatting)
IDENTIFIER PARTY/ADDRESS
Plaintiff DOE JOHN
1313 Mockingbird Lane <-row (merged, contains entire address)
Winchester, MA 00000
Defendant DOE JANE
100 Whatever Way
Boston, MA 000000
First I tried doing something like this to copy over a name IF a condition is met:
=IF(A2 = "Defendant:", B2, "")
which would copy the name over. Except I couldn’t figure out how to copy the next one cell down (really two because of the merge), so that I would end up with:
DOE JANE
100 Whatever Way
Boston, MA 000000
Because of the extra rows I couldn’t apply the same IF statement for the address. Trying to select “Blank” rows won’t work, because it would pick the empty cells beneath the identifier and also pick the “empty” merged cell – it would warp the whole sheet.
I also tried conditional formatting like:
=OR($A2 = "Defendant:")
and applied coloring to that row, but again, I don’t know how to select the address cell(s). When I filter on the color it just shows “Defendant: NAME”.
I was hoping to avoid VBA if at all possible.
Any suggestions? Thanks.
You may be interested in these two functions:
MATCH()finds the index of the first cell containing a certain value.OFFSET()selects a cell that is a certain number of rows/columns from a specific cell.for example, in your case you might use the formula to select Plaintiff’s address: