How to organise this data (Year, Vendor, expenses)

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
try this


Book1
ABCD
1Vendor201620172018
21999010034-264340.18-243313.18-341448.27
31999075412-68895.33-21482.1-26083.51
41999070532-50470.58-49838.33
51999063417-46591.22-68381.6-54325.09
61999056490-45247.37-116490.32
71999012433-29823.91
81999089508-20908.18
91999011400-19409.59-4500.36
101999081476-2941.7-7353.85
117999003105-7012.73
Output
Cell Formulas
RangeFormula
B2=IFERROR(INDEX(INDIRECT("'"&B$1&"'!C:C"),MATCH($A2,INDIRECT("'"&B$1&"'!B:B"),0)),"")
 
Upvote 0

If I wanted to find top 10 expenses for each year, which option would be the recommended one: power query or pivot tables?

I tried pivot tables but I'm pretty sure I am not doing it very efficiently to achieve my output.

Thank you for your solution, Alan, I appreciate it :)
 
Upvote 0
something like this?

part of the PivotTable:

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Sum of USD[/td][td=bgcolor:#DDEBF7]Year[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Vendor[/td][td=bgcolor:#DDEBF7]
2016
[/td][td=bgcolor:#DDEBF7]
2017
[/td][td=bgcolor:#DDEBF7]
2018
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999005689​
[/td][td][/td][td]
-38882.04​
[/td][td]
-7770.16​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999005960​
[/td][td][/td][td]
-11094.72​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999006006​
[/td][td]
-16183.56​
[/td][td]
-15855.45​
[/td][td]
-14130.15​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999006846​
[/td][td][/td][td]
-6073.01​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999007418​
[/td][td]
-8995.86​
[/td][td]
-6250.02​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999008286​
[/td][td][/td][td]
-21478.49​
[/td][td]
-8754.49​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999009851​
[/td][td]
-71866.39​
[/td][td]
-56313.15​
[/td][td]
-54623.42​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999010034​
[/td][td]
-264340.18​
[/td][td]
-243313.18​
[/td][td]
-341448.27​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999011390​
[/td][td]
-14248.07​
[/td][td]
-34182.82​
[/td][td]
-6344.01​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999011400​
[/td][td]
-19409.59​
[/td][td]
-4500.36​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999011602​
[/td][td][/td][td]
-17870.2​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999012396​
[/td][td][/td][td]
-3014.44​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999012433​
[/td][td]
-29823.91​
[/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999014359​
[/td][td]
-246531.43​
[/td][td]
-151410.71​
[/td][td]
-359535.34​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999014542​
[/td][td][/td][td][/td][td]
-7822.91​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999014618​
[/td][td][/td][td]
-3818.5​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999014834​
[/td][td]
-227689.18​
[/td][td]
-194781.46​
[/td][td]
-56963.96​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999015782​
[/td][td]
-9106.3​
[/td][td]
-28455.15​
[/td][td]
-11298​
[/td][/tr]
[/table]
 
Upvote 0
or

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Sum of USD[/td][td=bgcolor:#DDEBF7]Year[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Vendor[/td][td=bgcolor:#DDEBF7]
2016
[/td][td=bgcolor:#DDEBF7]
2017
[/td][td=bgcolor:#DDEBF7]
2018
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999009851​
[/td][td]
-71866.39​
[/td][td]
-56313.15​
[/td][td]
-54623.42​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999010034​
[/td][td]
-264340.18​
[/td][td]
-243313.18​
[/td][td]
-341448.27​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999014359​
[/td][td]
-246531.43​
[/td][td]
-151410.71​
[/td][td]
-359535.34​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999014834​
[/td][td]
-227689.18​
[/td][td]
-194781.46​
[/td][td]
-56963.96​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999016925​
[/td][td]
-223466.2​
[/td][td]
-59121.83​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999017909​
[/td][td]
-214366.55​
[/td][td]
-249918.03​
[/td][td]
-220363.56​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999057232​
[/td][td]
-432924.34​
[/td][td]
-426041.09​
[/td][td]
-6492.33​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999063417​
[/td][td]
-46591.22​
[/td][td]
-68381.6​
[/td][td]
-54325.09​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999067483​
[/td][td]
-354493.37​
[/td][td]
-692218.8​
[/td][td]
-201080.1​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999090540​
[/td][td][/td][td]
-85333.34​
[/td][td]
-84593.87​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Grand Total[/td][td=bgcolor:#DDEBF7]
-2082268.86
[/td][td=bgcolor:#DDEBF7]
-2226833.19
[/td][td=bgcolor:#DDEBF7]
-1379425.94
[/td][/tr]
[/table]
 
Upvote 0
Hi Sandy,
How did you create your first result?

This is how I did it, but it felt 'messy'/unorganized:
I created a pivot table for each sheet
Filtered to Bottom 10 for each. So now, I have three pivot tables.
I then copied and pasted the values for each pivot table into another spreadsheet.
Then I pivoted that table.
Interested to know how you would have done it?
 
Upvote 0
append Years via PowerQuery then create PivotTable, sort and filter Top10 or Bottom10
 
Upvote 0
No, I mean how did you get your output in your post 4 .
What you described is for post 5 , which shows top/bottom 10 vendors filtered by grand total.

Your output in post 4 shows top/bottom 10 vendors for each year (except 2017, which shows more than 10) but I need that output
 
Last edited:
Upvote 0
as you probably read in post#4 this is a part of bigger table just without TopTen

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Sum of USD[/td][td=bgcolor:#DDEBF7]Year[/td][td=bgcolor:#DDEBF7][/td][td=bgcolor:#DDEBF7][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Vendor[/td][td=bgcolor:#DDEBF7]
2016
[/td][td=bgcolor:#DDEBF7]
2017
[/td][td=bgcolor:#DDEBF7]
2018
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999005689​
[/td][td][/td][td]
-38882.04​
[/td][td]
-7770.16​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999005960​
[/td][td][/td][td]
-11094.72​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999006006​
[/td][td]
-16183.56​
[/td][td]
-15855.45​
[/td][td]
-14130.15​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999006846​
[/td][td][/td][td]
-6073.01​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999007418​
[/td][td]
-8995.86​
[/td][td]
-6250.02​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999008286​
[/td][td][/td][td]
-21478.49​
[/td][td]
-8754.49​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999009851​
[/td][td]
-71866.39​
[/td][td]
-56313.15​
[/td][td]
-54623.42​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999010034​
[/td][td]
-264340.18​
[/td][td]
-243313.18​
[/td][td]
-341448.27​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999011390​
[/td][td]
-14248.07​
[/td][td]
-34182.82​
[/td][td]
-6344.01​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999011400​
[/td][td]
-19409.59​
[/td][td]
-4500.36​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999011602​
[/td][td][/td][td]
-17870.2​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999012396​
[/td][td][/td][td]
-3014.44​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999012433​
[/td][td]
-29823.91​
[/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999014359​
[/td][td]
-246531.43​
[/td][td]
-151410.71​
[/td][td]
-359535.34​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999014542​
[/td][td][/td][td][/td][td]
-7822.91​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999014618​
[/td][td][/td][td]
-3818.5​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999014834​
[/td][td]
-227689.18​
[/td][td]
-194781.46​
[/td][td]
-56963.96​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999015782​
[/td][td]
-9106.3​
[/td][td]
-28455.15​
[/td][td]
-11298​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999016925​
[/td][td]
-223466.2​
[/td][td]
-59121.83​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999017909​
[/td][td]
-214366.55​
[/td][td]
-249918.03​
[/td][td]
-220363.56​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999018398​
[/td][td][/td][td]
-3553.16​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999019141​
[/td][td][/td][td]
-4432.94​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999043777​
[/td][td][/td][td]
-5745.46​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999049206​
[/td][td][/td][td]
-3272.28​
[/td][td]
-6567.99​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999056490​
[/td][td]
-45247.37​
[/td][td]
-116490.32​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999057232​
[/td][td]
-432924.34​
[/td][td]
-426041.09​
[/td][td]
-6492.33​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999057915​
[/td][td][/td][td]
-2898.97​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999058172​
[/td][td][/td][td]
-10048.87​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999063417​
[/td][td]
-46591.22​
[/td][td]
-68381.6​
[/td][td]
-54325.09​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999064801​
[/td][td]
-18657.26​
[/td][td]
-32955.62​
[/td][td]
-33872.39​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999067483​
[/td][td]
-354493.37​
[/td][td]
-692218.8​
[/td][td]
-201080.1​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999070532​
[/td][td]
-50470.58​
[/td][td]
-49838.33​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999075412​
[/td][td]
-68895.33​
[/td][td]
-21482.1​
[/td][td]
-26083.51​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999080098​
[/td][td][/td][td]
-4068.34​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999080175​
[/td][td][/td][td]
-3313.36​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999081217​
[/td][td][/td][td]
-29841.4​
[/td][td]
-28267.63​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999081476​
[/td][td][/td][td]
-2941.7​
[/td][td]
-7353.85​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999082979​
[/td][td][/td][td]
-4329.85​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999084715​
[/td][td]
-9857.09​
[/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999085347​
[/td][td][/td][td]
-5986.68​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999086132​
[/td][td][/td][td]
-5025.04​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999087107​
[/td][td][/td][td]
-22207.55​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999087108​
[/td][td][/td][td]
-11184.39​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999087319​
[/td][td][/td][td]
-6805.6​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999088163​
[/td][td][/td][td]
-4370.56​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999088522​
[/td][td]
-9453.25​
[/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999088957​
[/td][td][/td][td]
-2684.38​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999089508​
[/td][td]
-20908.18​
[/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999090257​
[/td][td]
-11710.56​
[/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
1999090540​
[/td][td][/td][td]
-85333.34​
[/td][td]
-84593.87​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999001074​
[/td][td][/td][td]
-3426.01​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999001146​
[/td][td][/td][td]
-3301.65​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999001754​
[/td][td][/td][td]
-103293.66​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999001991​
[/td][td][/td][td]
-18868.02​
[/td][td]
-59168.37​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999002245​
[/td][td][/td][td]
-38346.4​
[/td][td]
-68524.87​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999002587​
[/td][td][/td][td]
-5884.43​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999002591​
[/td][td][/td][td]
-14700​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999002741​
[/td][td][/td][td]
-22831.48​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999002753​
[/td][td][/td][td]
-68016.85​
[/td][td]
-15459.38​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999002979​
[/td][td][/td][td]
-4994.6​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999003105​
[/td][td][/td][td][/td][td]
-7012.73​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999003113​
[/td][td][/td][td][/td][td]
-46842.84​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999003427​
[/td][td][/td][td][/td][td]
-9626.24​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999005255​
[/td][td][/td][td][/td][td]
-38999​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999999399​
[/td][td][/td][td]
-37641.67​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999999458​
[/td][td][/td][td]
-8267.91​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999999471​
[/td][td][/td][td]
-25620.43​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
7999999991​
[/td][td][/td][td]
-5511.85​
[/td][td]
-7882.58​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]Grand Total[/td][td=bgcolor:#DDEBF7]
-2415235.77
[/td][td=bgcolor:#DDEBF7]
-3132490.25
[/td][td=bgcolor:#DDEBF7]
-1791207.04
[/td][/tr]
[/table]
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,139
Members
453,021
Latest member
Justyna P

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