+ Reply to Thread
Results 1 to 12 of 12

Can Excel solve my problem or do I need Access / Python?

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    7

    Can Excel solve my problem or do I need Access / Python?

    Hi everyone,

    I've spent a few days looking at how to solve a problem, firstly in Excel an then Access and now I'm more confused than ever! I've been looking into this for 3 days and I'm no further forward. Please bear with me, it is quite long winded.

    Its for a university project and I need to extract an answer from working on the data in order to move forward.

    I can work out this number by manually working through a number of steps but I need to do it for 100 different price points on weekly data for a 3 months which is not viable manually.

    These are the steps:

    This is a sample of the data;

    EVENT_ID ITEM_ID COUNTRY TRANSACTION_TIME PRICE NUMBER_TRANS VOLUME
    107802200 5931325 GB 26/12/2012 15:45:00 670 4 0.14
    107802200 5931325 GB 26/12/2012 15:45:00 880 3 0.18
    107802200 5975903 GB 26/12/2012 15:45:00 3 64 2259.2
    107802200 5975903 GB 26/12/2012 15:45:00 3 7 100.12

    The data is then filtered to a price, ie 2.

    EVENT_ID ITEM_ID COUNTRY TRANSACTION_TIME PRICE NUMBER_TRANS VOLUME
    107802200 5261525 GB 26/12/2012 15:45:00 2 37 1601.52
    107802200 5921132 GB 26/12/2012 15:45:00 2 46 833.5
    107802076 4056023 GB 26/12/2012 12:35:00 2 7 446.44
    107802078 3799249 GB 26/12/2012 13:10:00 2 55 1964.1

    I then copy this visible data to a new worksheet.

    I then insert a Pivot Table based on EVENT_ID and drag it in to the VALUES area so that I now know how many transactions there were at each event at the price level of 2.0 i.e.

    Row Labels COUNT
    107802076 1
    107802078 3
    107802080 1

    The business only makes money when the COUNT is more than 1.

    I then copy these values to another cell so I just have the values and not a formula from the Pivot Table.

    I then apply a formula to show the profit earned for each EVENT_ID

    https://dl.dropbox.com/u/86643329/screen.JPG

    Here's an image showing the worksheet and the formula. The formula for B1 is

    =100/(B2-1)

    B2 is the filter price from previously, in this case 2.0.

    I then total column F to show the profit at price 2.0

    My problem is this; I need to do these steps for every price from 1.01 to 2.00 ie 1.01, 1.02, 1.03 to have a final Excel document showing

    PRICE PROFIT
    1.01 XXX
    1.02 XXX
    1.03 XXX

    Is there a way to do this in Excel? Or do I need to try something else?

    Many thanks,

    Mark

    Also cross posted here;
    http://www.mrexcel.com/forum/excel-q...ml#post3360825
    Last edited by MHT888; 01-10-2013 at 09:08 AM.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Can Excel solve my problem or do I need Access / Python?

    Can you please upload a sample of your data in a workbook and the results that you want to achieve?

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Can Excel solve my problem or do I need Access / Python?

    oh and:
    I'm afraid your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

  4. #4
    Registered User
    Join Date
    01-10-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Can Excel solve my problem or do I need Access / Python?

    kyle123,

    Many thanks for your quick reply.

    The data as I receive it is like this;
    https://dl.dropbox.com/u/86643329/december26.xlsx

    I then filter it to one of the price points (in this example 2.0) and work on it as per this spreadsheet

    https://dl.dropbox.com/u/86643329/filteredto2.xlsx


    Many thanks,

    Mark

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Can Excel solve my problem or do I need Access / Python?

    See if this is what you are after. The results are put in columns J - N.

    https://www.dropbox.com/s/q9fgdqo0io...ecember26.xlsm

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  6. #6
    Registered User
    Join Date
    01-10-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Can Excel solve my problem or do I need Access / Python?

    abousetta,

    Many thanks for your help - it is some way to the full solution, but not entirely what I need.

    What I essentially need is a profit / loss column for every price point for the period in order that I can determine the optimum price.

    On the example you worked on I have randomly selected the price of 2.48.

    I set a filter of 2.48 for the PRICE column
    I sorted the EVENT_ID column low to high
    This now clearly shows every event and how many times we would sold at 2.48
    I have added a formula to columns M & N.
    Column N is the profit and loss column

    Column P & Q show the profit and loss figure clearly for 2.48.

    The figure in Q115 is the absolute key for me. It shows that if the company had sold the item at 2.48 at every opportunity they would have lost money.

    My goal is to have this figure for every price point from 1.01 to 3.0 in order to show the most beneficial price to sell.

    I've amended the Excel file to show this here: https://dl.dropbox.com/u/86643329/december26-5.xlsm

    Many thanks,

    Mark

  7. #7
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Can Excel solve my problem or do I need Access / Python?

    I'll have a look later today and get back to you. I wanted make sure I was on the right track before adding formulas.

    abousetta

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Can Excel solve my problem or do I need Access / Python?

    Have a look at the new attachment (https://www.dropbox.com/s/x0zup8xvsr...ember26-5.xlsm). I added a series of formulas that should provide you with the data you need. You might want to double check the outliers to make sure they are correct.

    Let me know if this works for you.

    abousetta

  9. #9
    Registered User
    Join Date
    01-10-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Can Excel solve my problem or do I need Access / Python?

    abousetta,

    Thank you so much for your help - with the addition of a SUMIF column I can get exactly the information I needed.

    Would you be able to explain the steps that you took?

    Thank you again,

    Mark

  10. #10
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Can Excel solve my problem or do I need Access / Python?

    First part was as before and used scripting dictionary to count the number of unique keys.

    Then (out of simplicity) I added the formulas to the row of the newly formed columns and dragged down.

    Last step of course was just to create the a line graph to visualize the results.

    abousetta

    P.S. Below is the vba code I used:

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    01-10-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Can Excel solve my problem or do I need Access / Python?

    abousetta,

    I added your code to the most recent spreadsheet (2-jan) but the results that are in columns J and K on the spreadsheet your kindly worked on are merged into Column J like this "107822264|1.1"

    Have I done something wrong?

    New speadsheet is here: https://dl.dropbox.com/u/86643329/2-jan.xlsm

  12. #12
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Can Excel solve my problem or do I need Access / Python?

    It ran fine on my computer and it also worked when I did it manually. In any case, if it happens again, you can either do it manually by highlighting all of Column J >> Data >> Text to Columns >> Other >> pipe character (|) [which is shift + forward slash]. Or you can create a single line sub to run:

    Please Login or Register  to view this content.
    abousetta

+ 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