+ Reply to Thread
Results 1 to 7 of 7

Could a pivot table solve this (extensive) problem?

Hybrid View

  1. #1
    Registered User
    Join Date
    05-23-2013
    Location
    Brasschaat, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    8

    Could a pivot table solve this (extensive) problem?

    I have a question to which I think I know the answer, but because it's so much work I'd like to confirm beforehand.

    My problem is as follows: For driving to work, an employee gets several types of reimbursements. His trajectory is made up of 2 parts: part one from his home to a meeting point, part 2 from the meeting point to the work place. He gets different kinds of reimbursements for part 1 than he does for part 2. The distances of parts 1 and 2, separately, are both between 1 and 200 kilometers (rounded to natural numbers). Hence, there are a total of 40 000 (200*200) possible reimbursement amounts (assuming reimbursements vary per kilometer).

    I'd like to show these 40 000 amounts in a matrix (so you could see quickly, for example: what the employee's reimbursement would be if his first trajectory is 25 km and his second 113).

    I'm thinking of getting there as follows:

    Make 40 000 Excel lines, column 1 containing the distance of trajectory 1 (a 200-times recurring loop of 1 to 200), column 2 containing the distance of trajectory 2 (200 times 1 for the first loop, 200 times 2 for the second, etc) and column C the reimbursement amount. Then I make a pivot with column 1 as a row heading, column 2 as a column heading and column C as a value.

    Would this work?

    Thanks

  2. #2
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    522

    Re: Could a pivot table solve this (extensive) problem?

    Hello Swarles & welcome to the forum.
    In my opinion Pivot Table may not be the right choice Here. As per my understanding i think Vlookup or Index match may come more handy.
    Lets wait form some experts opion. How about uploading a sample data file
    Best Regards/VKS

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,440

    Re: Could a pivot table solve this (extensive) problem?

    Don't you just want the rate for part 1 times the distance for part 1 plus the rate for part 2 times the distance for part 2 ??

    Pete

  4. #4
    Registered User
    Join Date
    05-23-2013
    Location
    Brasschaat, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Could a pivot table solve this (extensive) problem?

    I will clarify: calculating any reimbursement based on any 2 distances is very easy; I could enter a couple of formula and create a sheet where you just enter the distance for trajectory 1 and the distance for trajectory 2 and you get the reimbursement amount.

    The issue is that that's not really what I need. Imagine if you'd have to print every possible solution, with Excel as the source data, and you'd want to waste the least possible amount of paper.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,440

    Re: Could a pivot table solve this (extensive) problem?

    Well, having 40,000 rows is not going to save you much paper (say 100 rows deep, than will be almost a full ream).

    Better to do it as a table, with 0 to 200 going across on row 1 (starting from B1), and 0 to 200 going down in column A (starting from A2), and then you can have this formula in B2:

    =B$1*rate_1 + $A2*rate_2

    then copy this across and down to create your table. Then when you print that you can probably use only 3 pages going down and maybe 10 pages going across.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    05-23-2013
    Location
    Brasschaat, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Could a pivot table solve this (extensive) problem?

    Ha a simple data table is actually what I wanted to get to. I just thought to get there through a pivot table, which is a huge amount of unnecessary work. I got it now, thanks guys.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Could a pivot table solve this (extensive) problem?

    Use a data table?

    Or to generate PT data set.
    In row 2 use the following,

    for Trajectory1,
    =MOD(ROW()-2,200)+1

    for Trajectory2
    =INT((ROW()-2)/200)+1

    And column C would be a calculation of the amount.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1