Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrap rows in Excel [closed]

Let's say there is a report to compare charges with adjustments that outputs to excel, such that each row has the following fields:

  • Account Number
  • charge date
  • Original item number
  • Adjusted Item number
  • Original Qty
  • Adjusted Qty
  • Original amount
  • Adjusted amount
  • Original Post date
  • Adjusted Post date

I need to help a user create a view in Excel that helps them spot changes in each record. She wants it to show each record in two rows like this:

Account  |  Date  |  O. Item  |  O. Qty  |  O. Amount  |  O. Post
         |        |  A. Item  |  A. Qty  |  A. Amount  |  A. Post             

Is there anything built into Excel to allow you to group records like this? VBA is not an option in this case.

It's okay if the cells under account and date duplicate those values, if that makes it easier. Bonus points if you can get some kind of alternating row effect that helps delimit each record (that part I can do on my own in vba later if I have to).

like image 686
Joel Coehoorn Avatar asked Nov 19 '25 23:11

Joel Coehoorn


1 Answers

It is a little tricky, but doable. I'm looking into this currently, stand by.

Okay, the idea is this.

You have the following layout:

/|    A    |    B    |    C    |    D    |    F    |
-+---------+---------+---------+---------+---------+
1| Acc No. |  Data1  |  Data1' |  Data2  |  Data2' |
2|       1 |      10 |      11 |    a    |    b    |
3|       2 |     100 |     108 |    a    |    a    |
4|       3 |      50 |      55 |    f    |    g    |

Make a second Sheet:

/|  A  |  B  |    C                        |    D                        |
-+-----+-----+-----------------------------+-----------------------------+
1| A/O | Ref |  Data1                      |  Data2                      |
2|   A |   2 | =INDIRECT("Sheet1!B" & $B2) | =INDIRECT("Sheet1!D" & $B2) |
3|   O |   2 | =INDIRECT("Sheet1!C" & $B3) | =INDIRECT("Sheet1!E" & $B3) |
4|   A |   3 | =INDIRECT("Sheet1!B" & $B4) | =INDIRECT("Sheet1!D" & $B4) |
5|   O |   3 | =INDIRECT("Sheet1!C" & $B5) | =INDIRECT("Sheet1!E" & $B5) |

Columns "A/0" and "Ref" are manual, in my current model. Probably there is a way to automate them but I wanted to keep it simple. Filling down to cover an arbitrarily long input table in Sheet1 would work.

like image 176
Tomalak Avatar answered Nov 21 '25 14:11

Tomalak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!