Group data from column into separate rows horizontally

chhantelravi

New Member
Joined
Aug 11, 2020
Messages
6
Office Version
  1. 2016
  2. 2013
Platform
  1. Windows
Hi Everyone,

I have a data file which looks like below attachment.
1597141342755.png

I need to modify it as per my report format which is attached below.
1597141447677.png


Its really time consuming and hectic for huge files. So can anyone have any idea how to do this?
I would really appreciate help from excel geniuses..
Thanks
Ravi
 

Attachments

  • 1597141167261.png
    1597141167261.png
    24.3 KB · Views: 2

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Welcome to the MrExcel board

How does XYZ co magically turn into Mega Foods And beverage Pvt. Ltd in row 8?
Similarly ABC Co -> Four Square International Pvt. Ltd. in row 11?
 
Upvote 0
Welcome to the MrExcel board

How does XYZ co magically turn into Mega Foods And beverage Pvt. Ltd in row 8?
Similarly ABC Co -> Four Square International Pvt. Ltd. in row 11?
My bad...
Assume they are same company...
Do you know how to show amount in separate column for each entry???
 
Upvote 0
Do you know how to show amount in separate column for each entry???
You haven't actually explained what triggers moving to a new column but see if this helps. If not please give more explanation & examples.

I also suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with. Then you wouldn't get very simplified data like I have used below.

Enter the first formula in E2 and it should spill down that column in your table. Then select that column of formulas and drag right into the other columns.

chhantelravi 2020-08-12 1.xlsm
ABCDEFGH
1Doc #DescDebitCreditAmount 1Amount 2Amount 3Amount 4
2Desc 111   
3Desc 222   
4Desc 33-3   
5Desc 4 (15%)4-4   
6Desc 555   
7Desc 6 (13%)6 6  
8Desc 77 -7  
9Desc 88 8  
10Desc 9 (13%)9  9 
11Desc 1010  -10 
12Desc 1111  11 
Sheet1
Cell Formulas
RangeFormula
E2:H12E2=IF(MAX(COUNTIF($B$1:$B2,"*%)"),1)=COLUMNS($E:E),IF($D2="",1,-1)*SUM($C2:$D2),"")
 
Upvote 0
You haven't actually explained what triggers moving to a new column but see if this helps. If not please give more explanation & examples.

I also suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with. Then you wouldn't get very simplified data like I have used below.

Enter the first formula in E2 and it should spill down that column in your table. Then select that column of formulas and drag right into the other columns.

chhantelravi 2020-08-12 1.xlsm
ABCDEFGH
1Doc #DescDebitCreditAmount 1Amount 2Amount 3Amount 4
2Desc 111   
3Desc 222   
4Desc 33-3   
5Desc 4 (15%)4-4   
6Desc 555   
7Desc 6 (13%)6 6  
8Desc 77 -7  
9Desc 88 8  
10Desc 9 (13%)9  9 
11Desc 1010  -10 
12Desc 1111  11 
Sheet1
Cell Formulas
RangeFormula
E2:H12E2=IF(MAX(COUNTIF($B$1:$B2,"*%)"),1)=COLUMNS($E:E),IF($D2="",1,-1)*SUM($C2:$D2),"")
 
Upvote 0
Excel working.xlsx
ABCDEFGHI
1Original formatRequired Format
2Vr refAccount NameDr. AmountCr. AmountAccount Nametransaction1transaction2transaction3
31Labour Charges266,111.11Labour Charges266,111.11
41Labour Charges Payable263,450.00Labour Charges Payable(263,450.00)
51Withholding Tax - SST (1%)2,661.11Withholding Tax - SST (1%)(2,661.11)
62Intercompany Transactions - SMSK- TIGER60,000.00Intercompany Transactions - SMSK- TIGER60,000.00
72TDS Receivables1,500.00TDS Receivables1,500.00
82Sundry Debtros Control Account61,500.00Sundry Debtros Control Account(61,500.00)
93Intercompany Transactions190,000.00Intercompany Transactions190,000.00
103TDS Receivables30,000.00TDS Receivables30,000.00
113Sundry Debtros Control Account220,000.00Sundry Debtros Control Account(220,000.00)
124Employee Salary100,000.00
134PF - Employers Contribution10,000.00
144Gratuity10,000.00
154Accomodation Allowance50,000.00
164Salary Payable115,000.00
174Withholding Tax - SST (1%)10,000.00
184Withholding Tax - Salary (15%)25,000.00
194PF Payable10,000.00
204Gratuity Payable10,000.00
215NSBL-CA-BHW60,000.00
225PCBL - BHW_Account60,000.00
236NIBL- Current Account5,000.00
246PCBL - BHW_Account50,000.00
257Salary Payable50,000.00
267NSBL-CA-BHW50,000.00
278Salary Payable33,000.00
288NIBL- Current Account33,000.00
299Salary Payable2,449,066.30
309PCBL - BHW_Account2,449,066.30
3110Salary Payable2,667,147.00
3210HBL - USD Account2,560,460.54
3310Foreign Exchange Fluctuation Gain106,686.46
3411Intercompany Transactions500,000.00
3511TDS Receivables6,000.00
3611Rental Income506,000.00
3712Sundry Debtros Control Account40,000.00
3812Income from Space Rental_Lobby Lounge40,000.00
3913Sundry Debtros Control Account12,000.00
4013Income from Sale of Waste & Scrap12,000.00
4114Interest on Loan110,000.00
4214Interest Payable110,000.00
4316Sercurity charge1,133,661.29
4416Input VAT (13%)147,375.97
4516ABC Co1,281,037.26
4617ABC Co17,005.00
4717Withholding Tax - Contractual Payments17,005.00
4818Sales Commission422,870.00
4918Sales Commission321,674.00
5018Business Promotion Expense423,427.00
511882022-Lease Rental - Vehicle312,233.00
521882022-Lease Rental - Vehicle46,449.00
531882022-Lease Rental - Vehicle9,111.00
541882022-Lease Rental - Vehicle166,401.00
551882033-Internet Expenses185,851.00
561882041-Electricity Expense189,860.00
571882060-Festival & Pooja Expenses60,834.00
581882070-Pest Control Services476,261.00
591882076-Program & Function Expense474,013.00
6018Gardening Expenses306,051.00
6118Financial Consultancy153,794.00
6218Legal Consultancy386,301.00
6318SPA fees59,350.00
6418Management Service Fees75,079.00
6518Provision for Expenses4,069,559.00
6619Financial Audit Fee45,833.33
6719Provision for audit Fees45,833.33
6820Employee Dashain Bonus100,000.00
6920Provision for Festival Bonus100,000.00
Sheet1



above attached file is I am working on.. I tried your previous suggestion but it didn't work.
Can you look the file and suggest?
Is it possible perform with power query? If yes, Pls advise.

Thanks
 
Upvote 0
You haven't actually explained what triggers moving to a new column ..
You still haven't explained that but looking again I see that it is likely when the value in column a changes?

If so, here is one way with a helper column that could be hidden.

chhantelravi 2020-08-12 1.xlsm
ABCDEFGHIJ
1Original formatRequired Format
2Vr refAccount NameDr. AmountCr. AmountAccount Nametransaction1transaction2transaction3
31Labour Charges266111.1111Labour Charges1266111.11  
41Labour Charges Payable263450Labour Charges Payable1(263450.00)  
51Withholding Tax - SST (1%)2661.111111Withholding Tax - SST (1%)1(2661.11)  
62Intercompany Transactions - SMSK- TIGER60000Intercompany Transactions - SMSK- TIGER2 60000.00 
72TDS Receivables1500TDS Receivables2 1500.00 
82Sundry Debtros Control Account61500Sundry Debtros Control Account2 (61500.00) 
93Intercompany Transactions190000Intercompany Transactions3  190000.00
103TDS Receivables30000TDS Receivables3  30000.00
113Sundry Debtros Control Account220000Sundry Debtros Control Account3  (220000.00)
124Employee Salary100000Employee Salary4   
134PF - Employers Contribution10000PF - Employers Contribution4   
144Gratuity10000Gratuity4   
Sheet2
Cell Formulas
RangeFormula
F3:F14F3=B3
G3:G14G3=G2+(A3<>A2)
H3:J14H3=IF(COLUMNS($H:H)=$G3,IF($D3="",1,-1)*SUM($C3:$D3),"")



Is it possible perform with power query? If yes, Pls advise.
It is, but I don't answer forum questions about that. There are others who do and I'm sure at least one of them will chime in with a PQ solution.
 
Upvote 0
Just looked at this again and not sure why I made it like that. The formula for columns H, I, J, .. could be simpler ..

chhantelravi 2020-08-12 1.xlsm
ABCDEFGHIJ
1Original formatRequired Format
2Vr refAccount NameDr. AmountCr. AmountAccount Nametransaction1transaction2transaction3
31Labour Charges266111.1111Labour Charges1266111.11  
41Labour Charges Payable263450Labour Charges Payable1(263450.00)  
51Withholding Tax - SST (1%)2661.111111Withholding Tax - SST (1%)1(2661.11)  
62Intercompany Transactions - SMSK- TIGER60000Intercompany Transactions - SMSK- TIGER2 60000.00 
72TDS Receivables1500TDS Receivables2 1500.00 
82Sundry Debtros Control Account61500Sundry Debtros Control Account2 (61500.00) 
93Intercompany Transactions190000Intercompany Transactions3  190000.00
103TDS Receivables30000TDS Receivables3  30000.00
113Sundry Debtros Control Account220000Sundry Debtros Control Account3  (220000.00)
Sheet3
Cell Formulas
RangeFormula
F3:F11F3=B3
G3:G11G3=G2+(A3<>A2)
H3:J11H3=IF(COLUMNS($H:H)=$G3,IF($D3="",$C3,-$D3),"")



.. or if columns C:D are not formulas ..

chhantelravi 2020-08-12 1.xlsm
ABCDEFGHIJ
2Vr refAccount NameDr. AmountCr. AmountAccount Nametransaction1transaction2transaction3
31Labour Charges266111.1111Labour Charges1266111.11  
41Labour Charges Payable263450Labour Charges Payable1(263450.00)  
51Withholding Tax - SST (1%)2661.111111Withholding Tax - SST (1%)1(2661.11)  
62Intercompany Transactions - SMSK- TIGER60000Intercompany Transactions - SMSK- TIGER2 60000.00 
72TDS Receivables1500TDS Receivables2 1500.00 
82Sundry Debtros Control Account61500Sundry Debtros Control Account2 (61500.00) 
93Intercompany Transactions190000Intercompany Transactions3  190000.00
103TDS Receivables30000TDS Receivables3  30000.00
113Sundry Debtros Control Account220000Sundry Debtros Control Account3  (220000.00)
Sheet4
Cell Formulas
RangeFormula
F3:F11F3=B3
G3:G11G3=G2+(A3<>A2)
H3:J11H3=IF(COLUMNS($H:H)=$G3,$C3-$D3,"")
 
Upvote 0

Forum statistics

Threads
1,215,580
Messages
6,125,654
Members
449,245
Latest member
PatrickL

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