Calculate running interest rate

askall1000

Board Regular
Joined
Jan 3, 2019
Messages
58
Office Version
  1. 2016
Platform
  1. Windows
Hello to all, Thank you very much for your assistant in advance. I want to calculate interest for customers; for example for customer A like this interest calculate in 2010 with interest rate 15% and calculated interest amount plus amount transferred to 2011 calculated with interest rate of 2011 and then calculated 2011 payments from 20% interest rate and goes on like that for the following years: 2010 interest amount+amount:30.555,94 transferred to 2011, in 2011 (30.555,94*0,2(yearly)=6.111) and plus 2011 amounts and interest amounts 2.199,01. So if there is 2012 the transferred amount would be 38.866,14. Is there any suggestion to this calculation with pivot table or formula arrangement to calculate this for each customer with automated.

Book3
ABCDEFGHI
1Customer NameDateAmountMaturity DateDayInterest RateInterest Amount
2Customer A04.01.20105.000,0030.06.20131.273,000,152.615,75
3Customer A12.01.20109.990,0030.06.20131.265,000,155.193,43
4Customer A03.02.2010533,0030.06.20131.243,000,15272,27
5Customer A02.03.2010533,0030.06.20131.216,000,15266,3530.555,94
6Customer A02.04.2010533,0030.06.20131.185,000,15259,5630555,941
7Customer A05.05.2010533,0030.06.20131.152,000,15252,346111,1882
8Customer A27.05.2010533,0030.06.20131.130,000,15247,522.199,01
9Customer A05.07.2010533,0030.06.20131.091,000,15238,9738.866,14
10Customer A05.08.2010533,0030.06.20131.060,000,15232,18
11Customer A01.09.2010533,0030.06.20131.033,000,15226,27
12Customer A04.10.2010533,0030.06.20131.000,000,15219,04
13Customer A04.11.2010533,0030.06.2013969,000,15212,25
14Customer A03.12.2011533,0030.06.2013575,000,2167,93
15Customer A03.01.20111.000,0030.06.2013909,000,2498,08
16Customer B14.01.20111.000,0030.06.2013898,000,2492,05
17Customer B18.01.201122.340,0030.06.2013894,000,210.943,54
18Customer B12.07.2011778,0030.06.2013719,000,2306,51
19Customer B23.08.2011778,0030.06.2013677,000,2288,61
20Customer B28.09.2011778,0030.06.2013641,000,2273,26
21Customer B21.10.2011778,0030.06.2013618,000,2263,45
22Customer B23.11.2011778,0030.06.2013585,000,2249,39
23Customer B23.12.2011778,0030.06.2013555,000,2236,60
24Customer B10.12.20111.708,0030.06.2013568,000,2531,59
25Customer B10.12.20111.708,0030.06.2013568,000,2531,59
26Customer B10.12.20111.708,0030.06.2013568,000,2531,59
27Customer B10.12.20111.708,0030.06.2013568,000,2531,59
28Customer B10.12.20111.708,0030.06.2013568,000,2531,59
29Customer B28.10.2011534,0030.06.2013611,000,2178,78
30Customer B10.12.20111.174,0030.06.2013568,000,2365,39
31Customer B28.10.20111.708,0030.06.2013611,000,2571,83
32Customer B28.10.20111.708,0030.06.2013611,000,2571,83
33Customer B28.10.20111.708,0030.06.2013611,000,2571,83
34Customer B24.10.2011866,0030.06.2013615,000,2291,83
35Customer B28.10.2011842,0030.06.2013611,000,2281,90
36Customer B10.12.20111.574,0030.06.2013568,000,2489,88
37Customer B24.10.2011134,0030.06.2013615,000,245,16
38Customer B10.12.20111.708,0030.06.2013568,000,2531,59
39Customer B10.12.20111.708,0030.06.2013568,000,2531,59
40Customer B10.12.20111.708,0030.06.2013568,000,2531,59
41Customer B10.12.20111.708,0030.06.2013568,000,2531,59
42Customer B10.12.20111.708,0030.06.2013568,000,2531,59
43Customer B10.12.20111.708,0030.06.2013568,000,2531,59
44Customer B10.12.20111.708,0030.06.2013568,000,2531,59
45Customer B24.10.20111.000,0030.06.2013615,000,2336,99
46Customer B28.10.20116.500,0030.06.2013611,000,22.176,16
47Customer B10.12.201110.870,0030.06.2013568,000,23.383,10
48Customer B10.12.20115.886,0030.06.2013568,000,21.831,92
49Customer B21.12.20118.800,0030.06.2013557,000,22.685,81
50Customer C11.01.201013.177,0030.06.20131.266,000,156.855,65
51Customer C05.02.20101.086,0030.06.20131.241,000,15553,86
52Customer C05.03.20101.086,0030.06.20131.213,000,15541,36
53Customer C11.04.20101.086,0030.06.20131.176,000,15524,85
54Customer C01.04.201021.720,0030.06.20131.186,000,1510.586,27
55Customer C29.04.20101.086,0030.06.20131.158,000,15516,82
56Customer C01.06.20101.086,0030.06.20131.125,000,15502,09
57Customer C29.06.20101.086,0030.06.20131.097,000,15489,59
58Customer C02.08.20101.086,0030.06.20131.063,000,15474,42
59Customer C13.09.20101.086,0030.06.20131.021,000,15455,67
60Customer C04.10.20101.086,0030.06.20131.000,000,15446,30
61Customer C08.11.20101.086,0030.06.2013965,000,15430,68
62Customer C08.12.20101.086,0030.06.2013935,000,15417,29
63Customer C30.12.201015.566,0030.06.2013913,000,155.840,45
64Customer C08.06.201140.500,0030.06.2013753,000,216.710,41
65Customer C14.05.2011500,0030.06.2013778,000,2213,15
66Customer C10.06.2011500,0030.06.2013751,000,2205,75
67Customer C28.07.201122.000,0030.06.2013703,000,28.474,52
68Customer C15.06.201159.500,0030.06.2013746,000,224.321,64
69Customer C28.12.201140.000,0030.06.2013550,000,212.054,79
70Customer C21.12.20111.000,0030.06.2013557,000,2305,21
71Customer C23.07.2011500,0030.06.2013708,000,2193,97
72Customer C26.12.20111.000,0030.06.2013552,000,2302,47
73Customer C25.11.20111.000,0030.06.2013583,000,2319,45
74Customer C26.10.20111.000,0030.06.2013613,000,2335,89
75Customer C26.09.20111.000,0030.06.2013643,000,2352,33
76Customer C25.08.20111.000,0030.06.2013675,000,2369,86
77Customer C28.07.20116.460,0030.06.2013703,000,22.488,43
78Customer C10.10.201127.600,0030.06.2013629,000,29.512,55
79Customer C04.06.2011500,0030.06.2013757,000,2207,40
80Customer C27.12.2011569,0030.06.2013551,000,2171,79
81Customer C28.11.2011569,0030.06.2013580,000,2180,83
82Customer C26.10.2011569,0030.06.2013613,000,2191,12
83Customer C26.09.2011569,0030.06.2013643,000,2200,48
84Customer C25.08.2011569,0030.06.2013675,000,2210,45
85Customer C26.07.2011569,0030.06.2013705,000,2219,81
86Customer C27.06.2011569,0030.06.2013734,000,2228,85
87Customer C06.06.20112.620,0030.06.2013755,000,21.083,89
88Customer C26.09.201120.280,0030.06.2013643,000,27.145,23
Sheet1
Cell Formulas
RangeFormula
I5I5=SUM(C2:C13,G2:G13)
I7I7=+I6*0.2
I8I8=+SUM(C14:C15,G14:G15)
I9I9=+I5+I7+I8
E2:E88E2=+D2-B2
G2:G88G2=+F2*E2*C2/365
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Book1.xlsx
ABCDEFGHIJKLM
1Customer NameDateAmountMaturity DateDayInterest RateInterest AmountUnique Customer15%20%Result
2Customer A4-Jan-10500030-Jun-13127315%2615.753425Customer A30,555.948,310.2038,866.14
3Customer A12-Jan-10999030-Jun-13126515%5193.431507Customer B-125,022.83125,022.83
4Customer A3-Feb-1053330-Jun-13124315%272.2680822Customer C91,044.31335,152.13426,196.43
5Customer A2-Mar-1053330-Jun-13121615%266.3539726 30555.94
6Customer A2-Apr-1053330-Jun-13118515%259.5636986 30555.94
7Customer A5-May-1053330-Jun-13115215%252.3353425 6111.188
8Customer A27-May-1053330-Jun-13113015%247.5164384 2199.014
9Customer A5-Jul-1053330-Jun-13109115%238.9738356 38866.14
10Customer A5-Aug-1053330-Jun-13106015%232.1835616 
11Customer A1-Sep-1053330-Jun-13103315%226.2694521 
12Customer A4-Oct-1053330-Jun-13100015%219.0410959 
13Customer A4-Nov-1053330-Jun-1396915%212.2508219 
14Customer A3-Dec-1153330-Jun-1357520%167.9315068 
15Customer A3-Jan-11100030-Jun-1390920%498.0821918 
16Customer B14-Jan-11100030-Jun-1389820%492.0547945 
17Customer B18-Jan-112234030-Jun-1389420%10943.53973 
18Customer B12-Jul-1177830-Jun-1371920%306.5106849 
19Customer B23-Aug-1177830-Jun-1367720%288.6060274 
20Customer B28-Sep-1177830-Jun-1364120%273.2591781 
21Customer B21-Oct-1177830-Jun-1361820%263.4542466 
22Customer B23-Nov-1177830-Jun-1358520%249.3863014 
23Customer B23-Dec-1177830-Jun-1355520%236.5972603 
24Customer B10-Dec-11170830-Jun-1356820%531.5857534 
25Customer B10-Dec-11170830-Jun-1356820%531.5857534 
26Customer B10-Dec-11170830-Jun-1356820%531.5857534 
27Customer B10-Dec-11170830-Jun-1356820%531.5857534 
28Customer B10-Dec-11170830-Jun-1356820%531.5857534 
29Customer B28-Oct-1153430-Jun-1361120%178.780274 
30Customer B10-Dec-11117430-Jun-1356820%365.3873973 
31Customer B28-Oct-11170830-Jun-1361120%571.8290411 
32Customer B28-Oct-11170830-Jun-1361120%571.8290411 
33Customer B28-Oct-11170830-Jun-1361120%571.8290411 
34Customer B24-Oct-1186630-Jun-1361520%291.830137 
35Customer B28-Oct-1184230-Jun-1361120%281.8969863 
36Customer B10-Dec-11157430-Jun-1356820%489.8805479 
37Customer B24-Oct-1113430-Jun-1361520%45.15616438 
38Customer B10-Dec-11170830-Jun-1356820%531.5857534 
39Customer B10-Dec-11170830-Jun-1356820%531.5857534 
40Customer B10-Dec-11170830-Jun-1356820%531.5857534 
41Customer B10-Dec-11170830-Jun-1356820%531.5857534 
42Customer B10-Dec-11170830-Jun-1356820%531.5857534 
43Customer B10-Dec-11170830-Jun-1356820%531.5857534 
44Customer B10-Dec-11170830-Jun-1356820%531.5857534 
45Customer B24-Oct-11100030-Jun-1361520%336.9863014 
46Customer B28-Oct-11650030-Jun-1361120%2176.164384 
47Customer B10-Dec-111087030-Jun-1356820%3383.10137 
48Customer B10-Dec-11588630-Jun-1356820%1831.916712 
49Customer B21-Dec-11880030-Jun-1355720%2685.808219 
50Customer C11-Jan-101317730-Jun-13126615%6855.650137 
51Customer C5-Feb-10108630-Jun-13124115%553.86 
52Customer C5-Mar-10108630-Jun-13121315%541.3635616 
53Customer C11-Apr-10108630-Jun-13117615%524.850411 
54Customer C1-Apr-102172030-Jun-13118615%10586.26849 
55Customer C29-Apr-10108630-Jun-13115815%516.8169863 
56Customer C1-Jun-10108630-Jun-13112515%502.0890411 
57Customer C29-Jun-10108630-Jun-13109715%489.5926027 
58Customer C2-Aug-10108630-Jun-13106315%474.4183562 
59Customer C13-Sep-10108630-Jun-13102115%455.6736986 
60Customer C4-Oct-10108630-Jun-13100015%446.3013699 
61Customer C8-Nov-10108630-Jun-1396515%430.6808219 
62Customer C8-Dec-10108630-Jun-1393515%417.2917808 
63Customer C30-Dec-101556630-Jun-1391315%5840.448493 
64Customer C8-Jun-114050030-Jun-1375320%16710.41096 
65Customer C14-May-1150030-Jun-1377820%213.1506849 
66Customer C10-Jun-1150030-Jun-1375120%205.7534247 
67Customer C28-Jul-112200030-Jun-1370320%8474.520548 
68Customer C15-Jun-115950030-Jun-1374620%24321.64384 
69Customer C28-Dec-114000030-Jun-1355020%12054.79452 
70Customer C21-Dec-11100030-Jun-1355720%305.2054795 
71Customer C23-Jul-1150030-Jun-1370820%193.9726027 
72Customer C26-Dec-11100030-Jun-1355220%302.4657534 
73Customer C25-Nov-11100030-Jun-1358320%319.4520548 
74Customer C26-Oct-11100030-Jun-1361320%335.890411 
75Customer C26-Sep-11100030-Jun-1364320%352.3287671 
76Customer C25-Aug-11100030-Jun-1367520%369.8630137 
77Customer C28-Jul-11646030-Jun-1370320%2488.427397 
78Customer C10-Oct-112760030-Jun-1362920%9512.547945 
79Customer C4-Jun-1150030-Jun-1375720%207.3972603 
80Customer C27-Dec-1156930-Jun-1355120%171.7912329 
81Customer C28-Nov-1156930-Jun-1358020%180.8328767 
82Customer C26-Oct-1156930-Jun-1361320%191.1216438 
83Customer C26-Sep-1156930-Jun-1364320%200.4750685 
84Customer C25-Aug-1156930-Jun-1367520%210.4520548 
85Customer C26-Jul-1156930-Jun-1370520%219.8054795 
86Customer C27-Jun-1156930-Jun-1373420%228.8471233 
87Customer C6-Jun-11262030-Jun-1375520%1083.890411 
88Customer C26-Sep-112028030-Jun-1364320%7145.227397 
Sheet1
Cell Formulas
RangeFormula
G2:G88G2=+F2*E2*C2/365
H2:H88H2=IFERROR(INDEX($A$2:$A$88,SMALL(IF(FREQUENCY(IF($A$2:$A$88<>"",MATCH($A$2:$A$88,$A$2:$A$88,0)),ROW($A$2:$A$88)-ROW($A$2)+1),ROW($A$2:$A$88)-ROW($A$2)+1),ROWS(H$2:H2))),"")
I2:I4I2=SUMIFS($G$2:$G$88,$A$2:$A$88,$H2,$F$2:$F$88,I$1)+SUMIFS($C$2:$C$88,$A$2:$A$88,$H2,$F$2:$F$88,I$1)
J2:J4J2=SUMIFS($G$2:$G$88,$A$2:$A$88,$H2,$F$2:$F$88,J$1)+SUMIFS($C$2:$C$88,$A$2:$A$88,$H2,$F$2:$F$88,J$1)+I2*J$1
K2:K4K2=SUM(I2:J2)
M5M5=SUM(C2:C13,G2:G13)
M7M7=+M6*0.2
M8M8=+SUM(C14:C15,G14:G15)
M9M9=+M5+M7+M8
E2:E88E2=+D2-B2
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
Book1.xlsx
ABCDEFGHIJKLM
1Customer NameDateAmountMaturity DateDayInterest RateInterest AmountUnique Customer15%20%Result
2Customer A4-Jan-10500030-Jun-13127315%2615.753425Customer A30,555.948,310.2038,866.14
3Customer A12-Jan-10999030-Jun-13126515%5193.431507Customer B-125,022.83125,022.83
4Customer A3-Feb-1053330-Jun-13124315%272.2680822Customer C91,044.31335,152.13426,196.43
5Customer A2-Mar-1053330-Jun-13121615%266.3539726 30555.94
6Customer A2-Apr-1053330-Jun-13118515%259.5636986 30555.94
7Customer A5-May-1053330-Jun-13115215%252.3353425 6111.188
8Customer A27-May-1053330-Jun-13113015%247.5164384 2199.014
9Customer A5-Jul-1053330-Jun-13109115%238.9738356 38866.14
10Customer A5-Aug-1053330-Jun-13106015%232.1835616 
11Customer A1-Sep-1053330-Jun-13103315%226.2694521 
12Customer A4-Oct-1053330-Jun-13100015%219.0410959 
13Customer A4-Nov-1053330-Jun-1396915%212.2508219 
14Customer A3-Dec-1153330-Jun-1357520%167.9315068 
15Customer A3-Jan-11100030-Jun-1390920%498.0821918 
16Customer B14-Jan-11100030-Jun-1389820%492.0547945 
17Customer B18-Jan-112234030-Jun-1389420%10943.53973 
18Customer B12-Jul-1177830-Jun-1371920%306.5106849 
19Customer B23-Aug-1177830-Jun-1367720%288.6060274 
20Customer B28-Sep-1177830-Jun-1364120%273.2591781 
21Customer B21-Oct-1177830-Jun-1361820%263.4542466 
22Customer B23-Nov-1177830-Jun-1358520%249.3863014 
23Customer B23-Dec-1177830-Jun-1355520%236.5972603 
24Customer B10-Dec-11170830-Jun-1356820%531.5857534 
25Customer B10-Dec-11170830-Jun-1356820%531.5857534 
26Customer B10-Dec-11170830-Jun-1356820%531.5857534 
27Customer B10-Dec-11170830-Jun-1356820%531.5857534 
28Customer B10-Dec-11170830-Jun-1356820%531.5857534 
29Customer B28-Oct-1153430-Jun-1361120%178.780274 
30Customer B10-Dec-11117430-Jun-1356820%365.3873973 
31Customer B28-Oct-11170830-Jun-1361120%571.8290411 
32Customer B28-Oct-11170830-Jun-1361120%571.8290411 
33Customer B28-Oct-11170830-Jun-1361120%571.8290411 
34Customer B24-Oct-1186630-Jun-1361520%291.830137 
35Customer B28-Oct-1184230-Jun-1361120%281.8969863 
36Customer B10-Dec-11157430-Jun-1356820%489.8805479 
37Customer B24-Oct-1113430-Jun-1361520%45.15616438 
38Customer B10-Dec-11170830-Jun-1356820%531.5857534 
39Customer B10-Dec-11170830-Jun-1356820%531.5857534 
40Customer B10-Dec-11170830-Jun-1356820%531.5857534 
41Customer B10-Dec-11170830-Jun-1356820%531.5857534 
42Customer B10-Dec-11170830-Jun-1356820%531.5857534 
43Customer B10-Dec-11170830-Jun-1356820%531.5857534 
44Customer B10-Dec-11170830-Jun-1356820%531.5857534 
45Customer B24-Oct-11100030-Jun-1361520%336.9863014 
46Customer B28-Oct-11650030-Jun-1361120%2176.164384 
47Customer B10-Dec-111087030-Jun-1356820%3383.10137 
48Customer B10-Dec-11588630-Jun-1356820%1831.916712 
49Customer B21-Dec-11880030-Jun-1355720%2685.808219 
50Customer C11-Jan-101317730-Jun-13126615%6855.650137 
51Customer C5-Feb-10108630-Jun-13124115%553.86 
52Customer C5-Mar-10108630-Jun-13121315%541.3635616 
53Customer C11-Apr-10108630-Jun-13117615%524.850411 
54Customer C1-Apr-102172030-Jun-13118615%10586.26849 
55Customer C29-Apr-10108630-Jun-13115815%516.8169863 
56Customer C1-Jun-10108630-Jun-13112515%502.0890411 
57Customer C29-Jun-10108630-Jun-13109715%489.5926027 
58Customer C2-Aug-10108630-Jun-13106315%474.4183562 
59Customer C13-Sep-10108630-Jun-13102115%455.6736986 
60Customer C4-Oct-10108630-Jun-13100015%446.3013699 
61Customer C8-Nov-10108630-Jun-1396515%430.6808219 
62Customer C8-Dec-10108630-Jun-1393515%417.2917808 
63Customer C30-Dec-101556630-Jun-1391315%5840.448493 
64Customer C8-Jun-114050030-Jun-1375320%16710.41096 
65Customer C14-May-1150030-Jun-1377820%213.1506849 
66Customer C10-Jun-1150030-Jun-1375120%205.7534247 
67Customer C28-Jul-112200030-Jun-1370320%8474.520548 
68Customer C15-Jun-115950030-Jun-1374620%24321.64384 
69Customer C28-Dec-114000030-Jun-1355020%12054.79452 
70Customer C21-Dec-11100030-Jun-1355720%305.2054795 
71Customer C23-Jul-1150030-Jun-1370820%193.9726027 
72Customer C26-Dec-11100030-Jun-1355220%302.4657534 
73Customer C25-Nov-11100030-Jun-1358320%319.4520548 
74Customer C26-Oct-11100030-Jun-1361320%335.890411 
75Customer C26-Sep-11100030-Jun-1364320%352.3287671 
76Customer C25-Aug-11100030-Jun-1367520%369.8630137 
77Customer C28-Jul-11646030-Jun-1370320%2488.427397 
78Customer C10-Oct-112760030-Jun-1362920%9512.547945 
79Customer C4-Jun-1150030-Jun-1375720%207.3972603 
80Customer C27-Dec-1156930-Jun-1355120%171.7912329 
81Customer C28-Nov-1156930-Jun-1358020%180.8328767 
82Customer C26-Oct-1156930-Jun-1361320%191.1216438 
83Customer C26-Sep-1156930-Jun-1364320%200.4750685 
84Customer C25-Aug-1156930-Jun-1367520%210.4520548 
85Customer C26-Jul-1156930-Jun-1370520%219.8054795 
86Customer C27-Jun-1156930-Jun-1373420%228.8471233 
87Customer C6-Jun-11262030-Jun-1375520%1083.890411 
88Customer C26-Sep-112028030-Jun-1364320%7145.227397 
Sheet1
Cell Formulas
RangeFormula
G2:G88G2=+F2*E2*C2/365
H2:H88H2=IFERROR(INDEX($A$2:$A$88,SMALL(IF(FREQUENCY(IF($A$2:$A$88<>"",MATCH($A$2:$A$88,$A$2:$A$88,0)),ROW($A$2:$A$88)-ROW($A$2)+1),ROW($A$2:$A$88)-ROW($A$2)+1),ROWS(H$2:H2))),"")
I2:I4I2=SUMIFS($G$2:$G$88,$A$2:$A$88,$H2,$F$2:$F$88,I$1)+SUMIFS($C$2:$C$88,$A$2:$A$88,$H2,$F$2:$F$88,I$1)
J2:J4J2=SUMIFS($G$2:$G$88,$A$2:$A$88,$H2,$F$2:$F$88,J$1)+SUMIFS($C$2:$C$88,$A$2:$A$88,$H2,$F$2:$F$88,J$1)+I2*J$1
K2:K4K2=SUM(I2:J2)
M5M5=SUM(C2:C13,G2:G13)
M7M7=+M6*0.2
M8M8=+SUM(C14:C15,G14:G15)
M9M9=+M5+M7+M8
E2:E88E2=+D2-B2
Press CTRL+SHIFT+ENTER to enter array formulas.
Thank you very much for your help, it does what I want very well.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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