Row and column data manipulation

Henoclaide

New Member
Joined
Dec 24, 2021
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
What is easy and efficient way to move supplier name to new column in accordance where is data .See image as example

Accounts Payable Age Analysis_20211215_144233 - Copy.xlsx
ABCDEFGHIJ
5DateReference180 Days150 Days120 Days90 Days60 Days30 DaysCurrentBalance
6ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)
716/08/2021BCI-MZN Transf-1,359.12-1,359.12
817/08/2021BCI-MZN Transf-33,801.10-35,160.22
908/09/2021BCI-MZN Transf-1,064.69-36,224.91
1023/09/2021BCI-MZN Transf-2,744.76-38,969.67
1101/11/20212815750.00-38,219.67
1209/11/2021BCI-MZN Transf-78,463.00-116,682.67
1317/11/2021285311,726.88-104,955.79
1423/11/2021NED-MZN Transf-30,931.23-135,887.02
1526/11/2021286613,940.02-121,947.00
16Total for ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)-35,160.22-3,809.45-82,977.33-121,947.00
17ACPE01 (AC PECAS, Lda)
1822/11/2021CX-MZN 960-819.00-819.00
19Total for ACPE01 (AC PECAS, Lda)-819.00-819.00
20ADIL01 (Adilson da Silva)
2130/11/2021975107,640.00107,640.00
2230/11/202197623,400.00131,040.00
23Total for ADIL01 (Adilson da Silva)131,040.00131,040.00
24AFRI04 (Afri-Mechs Ltd)
2512/01/20212060,117.4260,117.42
2630/04/202129648,226.80708,344.22
27Total for AFRI04 (Afri-Mechs Ltd)708,344.22708,344.22
28AFRO01 (AFROX Mocambique Lda)
29Total for AFRO01 (AFROX Mocambique Lda)8,008.078,008.07
30AFST01 (Advanced Fire Supression Technologies)
3102/08/2021INV0286117,828.4617,828.46
32Total for AFST01 (Advanced Fire Supression Technologies)17,828.4617,828.46
33ALIE01 (Alie Investiment Lda)
3418/09/202130630.2430.24
3504/10/2021311560,000.10560,030.34
36Total for ALIE01 (Alie Investiment Lda)30.24560,000.10560,030.34
37AMEL01 (Amelia Z.T.S Rendicao)
3805/11/2021318540.0040.00
39Total for AMEL01 (Amelia Z.T.S Rendicao)40.0040.00
40ANIF01 (Anif Comercial )
4104/09/202124650.010.01
42Total for ANIF01 (Anif Comercial )0.010.01
43ASSO01 (Associacao Arteba)
4422/09/2021BU-MZN Transf-12,000.00-12,000.00
4502/10/20218930,000.0018,000.00
46Total for ASSO01 (Associacao Arteba)-12,000.0030,000.0018,000.00
47AUTO16 (Auto Sueco Mocambique (SA))
4825/10/2021A3/2021/731110300047,809.6347,809.63
4925/10/2021A3/2021/7311103001148,778.67196,588.30
50Total for AUTO16 (Auto Sueco Mocambique (SA))196,588.30196,588.30
51AUTO20 (Auto Stop Amirana, Lda)
5206/07/2021BU-MZN Transf-228,000.00-228,000.00
5302/08/2021MOZA-MZN Transf-228,000.00-456,000.00
54Total for AUTO20 (Auto Stop Amirana, Lda)-456,000.00-456,000.00
55AVAN01 (Avani Pemba Beach Hotel & Spa)
5608/11/2021165145/23,290.003,290.00
5708/11/2021165647/1154,879.96158,169.96
58Total for AVAN01 (Avani Pemba Beach Hotel & Spa)158,169.96158,169.96
Accounts Payable Age Analysis_2
 

Attachments

  • suppliers ageing.JPG
    suppliers ageing.JPG
    124.1 KB · Views: 9
Last edited by a moderator:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I see a Pivot Table. However, I'm guessing this is some output from another system as a Text file brought to Excel or an Excel file created by another system/software.
Preference is to Use PowerQuery for such clean up.
However, a manula method that's not too bad once you get used to all the bits....
Filter Column A for items beginning with "Total" and Delete.
Insert a New Column at A. Set the Header to "Supplier Name"
=IF(JRow=""),BRow,"")
Fill formula down to end of data.

Then a magic Trick. To fill down the Supplier Names....
Select Column A, Copy, Paste Values. You cannot have the formulas.
Select the range, CTRL+END, Home, SHIFT+CTRL+HOME
Press F5. In the Find Window, Choose the Blank Cells.
You should have multiple cells selected and like Cell A3 is activated. You will Type a formula to reference the cell above the current active cell, "=A2", the CTRL+ENTER.
That should have each blank cell reference the previous-above cell by formula, if the cell was blank. You need to convert the column to hard values using COPY, PASTE SPEACIAL/VALUES.
 
Upvote 0
Assuming you don't want to use Power Query or VBA,
I prefer to use a template and rely on a pivot for the actual report.
So I would normally put the formulas I have here to the right of the original data, then rely on the pivot to bring the names to the left.

If you are happy to use filters to filter out the rows with no Data then you can still use this a template, to refresh delete the data on the right and leave the formulas in place. Copy in the new data into Column C and just make sure the formulas cover the whole range.

If you are going to convert the formulas to values each time then either store the formulas on another sheet or set the formulas up in the Name Range Manager.

20211226 Fill Creditor Name Down.xlsx
ABCDEFGHIJKL
1NameData Row YNDateReference180 Days150 Days120 Days90 Days60 Days30 DaysCurrentBalance
2ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)NoABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)
3ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)Yes16/08/2021BCI-MZN Transf-1359.12-1359.12
4ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)Yes17/08/2021BCI-MZN Transf-33801.1-35160.22
5ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)Yes8/09/2021BCI-MZN Transf-1064.69-36224.91
6ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)Yes23/09/2021BCI-MZN Transf-2744.76-38969.67
7ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)Yes1/11/20212815750-38219.67
8ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)Yes9/11/2021BCI-MZN Transf-78463-116682.67
9ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)Yes17/11/2021285311726.88-104955.79
10ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)Yes23/11/2021NED-MZN Transf-30931.23-135887.02
11ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)Yes26/11/2021286613940.02-121947
12ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)YesTotal for ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)-35160.22-3809.45-82977.33-121947
13ACPE01 (AC PECAS, Lda)NoACPE01 (AC PECAS, Lda)
14ACPE01 (AC PECAS, Lda)Yes22/11/2021CX-MZN 960-819-819
15ACPE01 (AC PECAS, Lda)YesTotal for ACPE01 (AC PECAS, Lda)-819-819
16ADIL01 (Adilson da Silva)NoADIL01 (Adilson da Silva)
17ADIL01 (Adilson da Silva)Yes30/11/2021975107640107640
18ADIL01 (Adilson da Silva)Yes30/11/202197623400131040
19ADIL01 (Adilson da Silva)YesTotal for ADIL01 (Adilson da Silva)131040131040
Formatted Col A vrs 2
Cell Formulas
RangeFormula
A2:A19A2=IF(AND(NOT(ISERROR(FIND("(",C2))),LEFT(C2,5)<>"Total"),C2,A1)
B2:B19B2=IF(L2="","No","Yes")
 
Upvote 0
Solution
I see a Pivot Table. However, I'm guessing this is some output from another system as a Text file brought to Excel or an Excel file created by another system/software.
Preference is to Use PowerQuery for such clean up.
However, a manula method that's not too bad once you get used to all the bits....
Filter Column A for items beginning with "Total" and Delete.
Insert a New Column at A. Set the Header to "Supplier Name"
=IF(JRow=""),BRow,"")
Fill formula down to end of data.

Then a magic Trick. To fill down the Supplier Names....
Select Column A, Copy, Paste Values. You cannot have the formulas.
Select the range, CTRL+END, Home, SHIFT+CTRL+HOME
Press F5. In the Find Window, Choose the Blank Cells.
You should have multiple cells selected and like Cell A3 is activated. You will Type a formula to reference the cell above the current active cell, "=A2", the CTRL+ENTER.
That should have each blank cell reference the previous-above cell by formula, if the cell was blank. You need to convert the column to hard values using COPY, PASTE SPEACIAL/VALUES.
Hello SpillerBD
Thank you for prompt reply.
It is excel extracted from accounting software.
I have tried above instruction, the formula is not working. I taught the problem was the parenthesis that is missing but even did not work.
If I have to use Power query, what would I have to do?
Regards,
Henocláide
 
Upvote 0
Thank you, worked. If I have to use power query, what would I have to do?
 
Upvote 0
Thank you, worked. If I have to use power query, what would I have to do?
PowerQuery is pretty easy to learn. I always recommend Mike Girvin (ExcelIsFun) on you Tube for long instructions. There are others, but he is all around one of the best.
It looks like you have the invoice or due date from the accounting software and then that same software is putting it in the appropriate aging bucket.
I would calculate the days and then use the PivotTable functions to put in the correct bucket,

The Excel file must be in true XLSX format for Power Query to work with. That may be your first hurdle. A Text file can be just as easy.
Book resources would be the new(updated) from Puls and Escobar, Master Your Data with Power Query in Excel and PowerBI
 
Upvote 0
Your case is pretty straight forward in Power Query (PQ) and doesn't require any hard coding.
Just as a test run, I converted your data into a table called tblAgedCred.
(You can let PQ do that but I don't find the table being called Table1 all that helpful)
I then used the PQ interface to perform the following steps.

1640760924831.png


It generates the M Code below. If you wanted to you could paste that into a blank PQ query and if you use my table name tblAgedCred it should run without doing anything else.

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="tblAgedCred"]}[Content],
    AddedColumnName = Table.AddColumn(Source, "Supplier Name", each if [Balance] = null then [Date] else null),
    #"Filled Down Name" = Table.FillDown(AddedColumnName,{"Supplier Name"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Filled Down Name",{{"Date", type date}, {"Reference", type text}, {"180 Days", Currency.Type}, {"150 Days", Currency.Type}, {"120 Days", Currency.Type}, {"90 Days", Currency.Type}, {"60 Days", Currency.Type}, {"30 Days", Currency.Type}, {"Current", Currency.Type}, {"Balance", Currency.Type}, {"Supplier Name", type text}}),
    #"Removed Errors Date" = Table.RemoveRowsWithErrors(#"Changed Type", {"Date"}),
    #"Reordered Columns Name" = Table.ReorderColumns(#"Removed Errors Date",{"Supplier Name", "Date", "Reference", "180 Days", "150 Days", "120 Days", "90 Days", "60 Days", "30 Days", "Current", "Balance"})
in
    #"Reordered Columns Name"

Output looks like this:
20211226 Fill Creditor Name Down.xlsx
ABCDEFGHIJK
1Supplier NameDateReference180 Days150 Days120 Days90 Days60 Days30 DaysCurrentBalance
2ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)16/08/2021BCI-MZN Transf-1359.12-1359.12
3ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)17/08/2021BCI-MZN Transf-33801.1-35160.22
4ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)8/09/2021BCI-MZN Transf-1064.69-36224.91
5ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)23/09/2021BCI-MZN Transf-2744.76-38969.67
6ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)1/11/20212815750-38219.67
7ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)9/11/2021BCI-MZN Transf-78463-116682.67
8ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)17/11/2021285311726.88-104955.79
9ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)23/11/2021NED-MZN Transf-30931.23-135887.02
10ABDU01 (Abdul Karim Osman - Despachnte Aduaneiro)26/11/2021286613940.02-121947
11ACPE01 (AC PECAS, Lda)22/11/2021CX-MZN 960-819-819
12ADIL01 (Adilson da Silva)30/11/2021975107640107640
13ADIL01 (Adilson da Silva)30/11/202197623400131040
14AFRI04 (Afri-Mechs Ltd)12/01/20212060117.4260117.42
15AFRI04 (Afri-Mechs Ltd)30/04/202129648226.8708344.22
16AFST01 (Advanced Fire Supression Technologies)2/08/2021INV0286117828.4617828.46
17ALIE01 (Alie Investiment Lda)18/09/202130630.2430.24
18ALIE01 (Alie Investiment Lda)4/10/2021311560000.1560030.34
19AMEL01 (Amelia Z.T.S Rendicao)5/11/202131854040
20ANIF01 (Anif Comercial )4/09/202124650.010.01
21ASSO01 (Associacao Arteba)22/09/2021BU-MZN Transf-12000-12000
22ASSO01 (Associacao Arteba)2/10/2021893000018000
23AUTO16 (Auto Sueco Mocambique (SA))25/10/2021A3/2021/731110300047809.6347809.63
24AUTO16 (Auto Sueco Mocambique (SA))25/10/2021A3/2021/7311103001148778.67196588.3
25AUTO20 (Auto Stop Amirana, Lda)6/07/2021BU-MZN Transf-228000-228000
26AUTO20 (Auto Stop Amirana, Lda)2/08/2021MOZA-MZN Transf-228000-456000
27AVAN01 (Avani Pemba Beach Hotel & Spa)8/11/2021165145/232903290
28AVAN01 (Avani Pemba Beach Hotel & Spa)8/11/2021165647/1154879.96158169.96
tblAgedCred
 
Upvote 0
Oops I noticed by doing the PQ report that in my original post the formula in Column B "Data Row YN" should have been the below if you wanted to knock out the Totals rows as well.
Excel Formula:
=IF(OR(L2="",LEFT(C2,5)="Total"),"No","Yes")
 
Upvote 0

Forum statistics

Threads
1,215,276
Messages
6,124,006
Members
449,137
Latest member
abdahsankhan

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