Ping the Excel gurus.

Discussion in 'UK Motorcycles' started by Krusty, Jan 26, 2009.

  1. Krusty

    Krusty Guest

    I'm generating a spreadsheet from XML data, & it looks something like
    this:

    Client Name Total Val Cash Equities
    Mr Bloggs (Portfolio) £50,000 £3,000 £47,000
    Mr Bloggs (Model) £60,000 £4,000 £54,000
    Mr Bloggs (Difference) £10,000 £1,000 £7,000
    ....
    Mr Fred (Portfolio) £30,000 £1,000 £29,000
    Mr Fred (Model) £35,000 £2,000 £33,000
    Mr Fred (Difference) £5,000 £1,000 £4,000

    So client name in first column, total in second, cash in third, then
    the fourth onwards will be various share categories (equities, unit
    trusts, gilts etc - could be many columns). Each client has three rows
    - Portfolio, Model & Difference. There could be several hundred clients.

    The problem I've got is the people I'm doing this for want to be able
    to change the sort order in Excel. E.g. they may want it in ascending
    Total Val order, but obviously keeping each client's three rows grouped
    together (so in the above example Mr Fred's rows would move to the
    top). Then they might want to have a look by descending Equities, so Mr
    Bloggs' rows would move back to the top.

    My Excel skills extend to opening a spreadsheet, & on a good day,
    closing it again. I have no idea if what the client wants is even
    vaguely doable, let alone how to do it. Help!

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Jan 26, 2009
    #1
    1. Advertisements

  2. Krusty

    antonye Guest

    Data > Sort By ... > [Sort Dialog]

    Sort By: Total Val
    Then By: Client Name

    ....because you can specify more than one sort column.
     
    antonye, Jan 26, 2009
    #2
    1. Advertisements

  3. Krusty

    Pete Fisher Guest

    In communiqué
    Would that keep the three rows for each client grouped together?


    --
    +----------------------------------------------------------------+
    | Pete Fisher at Home: |
    | Voxan Roadster Gilera Nordwest * 2 Yamaha WR250Z |
    | Gilera GFR * 2 Moto Morini 2C/375 Morini 350 "Forgotten Error" |
    +----------------------------------------------------------------+
     
    Pete Fisher, Jan 26, 2009
    #3
  4. Krusty

    Krusty Guest

    That mixes all the clients up. I'm pretty sure it can't be done by
    sorting - what I don't know is whether it can be done by macros or
    something.

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Jan 26, 2009
    #4
  5. Krusty

    Krusty Guest

    Sadly not.

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Jan 26, 2009
    #5
  6. Krusty

    antonye Guest

    Probably not, but ask me if I care...

    I think this one involves a pivot table, doesn't it?
     
    antonye, Jan 26, 2009
    #6
  7. Krusty

    Simon Wilson Guest

    Not an Excel[1] expert, but IWHT that you would have to get each
    client's data all into one row first?

    [1]dislike it with a passion
     
    Simon Wilson, Jan 26, 2009
    #7
  8. Krusty

    antonye Guest

    Your right, I jumped the gun.

    I think you can do grouping in a pivot table.
     
    antonye, Jan 26, 2009
    #8
  9. Krusty

    Colin Irvine Guest

    The simplest way, although not elegant, would be to have additional
    columns. If, for example, the Equities value you're going to sort on
    is the Portfolio, you'd have an "Equities Sort" column with £47,000 in
    each of Mr Bloggs three rows and £29,000 in Mr Fred's three rows. You
    could then sort on this column first and the client name second.

    Personally I'd play around with pivot tables.
     
    Colin Irvine, Jan 26, 2009
    #9
  10. Using the patented Mavis Beacon "Hunt&Peck" Technique, Krusty
    Well, *I* know a way to do it... ;^)
     
    Wicked Uncle Nigel, Jan 26, 2009
    #10
  11. Krusty

    Krusty Guest

    Heh, don't worry, I haven't forgotten. Just trying to get a new client
    live, then you're next on my list.

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Jan 26, 2009
    #11
  12. Krusty

    Krusty Guest

    I did think of that as a last resort, but I really doubt they'd go for
    it. They're a fussy bunch.
    Seems to be getting lots of votes - I'll have a looksee.

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Jan 26, 2009
    #12
  13. Krusty

    Pete Fisher Guest

    We should form a sect.

    Once our site has been 'refreshed' am going to have to cobble up things
    in Excel that were an absolute doddle with a proper database 4GL.

    --
    +----------------------------------------------------------------+
    | Pete Fisher at Home: |
    | Voxan Roadster Gilera Nordwest * 2 Yamaha WR250Z |
    | Gilera GFR * 2 Moto Morini 2C/375 Morini 350 "Forgotten Error" |
    +----------------------------------------------------------------+
     
    Pete Fisher, Jan 26, 2009
    #13
  14. Krusty

    Colin Irvine Guest

    Actually I can't think of how to do it with a pivot table either. The
    problem is trying to sort on part of a column.
     
    Colin Irvine, Jan 26, 2009
    #14
  15. Krusty

    Pete Fisher Guest

    Shirely the wrong way around?

    Sort By: Client Name
    Then By: Total Val

    Would keep the names together.
    [/QUOTE]

    And the other two rows ?
    --
    +----------------------------------------------------------------+
    | Pete Fisher at Home: |
    | Voxan Roadster Gilera Nordwest * 2 Yamaha WR250Z |
    | Gilera GFR * 2 Moto Morini 2C/375 Morini 350 "Forgotten Error" |
    +----------------------------------------------------------------+
     
    Pete Fisher, Jan 26, 2009
    #15
  16. Krusty

    Krusty Guest

    Having had a quick look, I can't see how they'd help, & there's no way
    on earth the client would be able to use them even if I could convince
    them to try. I think the only answer is to give up.

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Jan 26, 2009
    #16
  17. Krusty

    Krusty Guest

    YTC.

    --
    Krusty

    '03 Tiger 955i
    '02 MV Senna (for sale) '96 Tiger (for sale)
    '79 Fantic Hiro 250 (for sale) '81 Corvette (for sale)
     
    Krusty, Jan 26, 2009
    #17
  18. Krusty

    Pete Fisher Guest

    You'll have to sub it out to WUN then.

    Having played about a bit with the Excel workbook that the NHCA
    archivist set up to record the times at hill climbs[1] and produce a
    results sheet, I'm sure. given the consistent worksheet structure, it
    can be done with VB macros, but WUN probably knows an easier way.


    [1] Whilst working out how to read it as an automation object from
    Visual Foxpro so as to display real time leader boards etc.
    --
    +----------------------------------------------------------------+
    | Pete Fisher at Home: |
    | Voxan Roadster Gilera Nordwest * 2 Yamaha WR250Z |
    | Gilera GFR * 2 Moto Morini 2C/375 Morini 350 "Forgotten Error" |
    +----------------------------------------------------------------+
     
    Pete Fisher, Jan 26, 2009
    #18

  19. Ranking and pivot table are the way to go.

    Use a formula to rank each client - ie in this case, Fred=1, Bloggs=2
    then drop the data into a pivot table around the ranking.

    Off the top of my head, you should get something like:



    Client Name Total Val Cash Equities Ranking

    Mr Fred (Difference) £5,000 £1,000 £4,000 1
    Mr Fred (Portfolio) £30,000 £1,000 £29,000 1
    Mr Fred (Model) £35,000 £2,000 £33,000 1

    Mr Bloggs (Difference) £10,000 £1,000 £7,000 2
    Mr Bloggs (Portfolio) £50,000 £3,000 £47,000 2
    Mr Bloggs (Model) £60,000 £4,000 £54,000 2

    You can then apply a Macro to a button graphic so that your client can
    just hit the button to run the ranking and pivot table in future.

    If you can't figure it out from here, drop me an email as the headers
    and I'll try and knock up an example for you.
     
    doetnietcomputeren, Jan 26, 2009
    #19
  20. Krusty

    Pete Fisher Guest

    I think Simon has the right of it when he mentions getting your data in
    to single rows for each client. You can then construct a list and have
    blocks of three rows (on a different sheet if required) as you want with
    the data displayed linked to that master set of rows. When you change
    the order of any of the master columns the blocks of data will change.

    See screenshot here (prolly need to save it or go full screen to see all
    its beauty):

    http://www.ps-fisher.demon.co.uk/pickchurs/krusty.jpg

    Fucknose how to quickly replicate the client 'record' blocks though I
    had to construct them by hand. Then there is reading your XML source
    data to the master rows if it arrives in the format you showed , so
    wibble flip.

    In any case I think your sums are wrong for Mr Bloggs (Model) unless he
    has model loot stashed in something else.


    --
    +----------------------------------------------------------------+
    | Pete Fisher at Home: |
    | Voxan Roadster Gilera Nordwest * 2 Yamaha WR250Z |
    | Gilera GFR * 2 Moto Morini 2C/375 Morini 350 "Forgotten Error" |
    +----------------------------------------------------------------+
     
    Pete Fisher, Jan 26, 2009
    #20
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.