#300953 - 27/07/2007 13:23
Excel help
|
carpal tunnel
Registered: 08/03/2000
Posts: 12341
Loc: Sterling, VA
|
Event logs are a pain to manipulate (but I also find it fun...). My office manager is trying to figure out who's utilizing our color printer the most, and has asked me for some info on it. I've gotten pretty far, but now I'm struggling with the more advanced formulas. So far I've taken a csv of the event viewer, created a function to tell me which print jobs were sent to one specific printer, sorted by that column, and removed the other print jobs. So now I have a spreadsheet with date, time, username, and the print job. The problem is that the description of the print job ends in the number of pages that were printed. In the column to the left of this description, I'd like to have a simple number representing the number of pages printed in that job. If it helps, the standard formatting of the messaged is, for example: "pages printed: 5" So the number is always the very last word/character in the cell (of course, many print jobs have over 200 pages, so it ranges from one digit to three). Would someone be so kind as to help me with a formula to extract this information? I'd really like to avoid going through 554 lines and entering them manually This also might be something that needs to be done regularly, so this will save me a lot of time in the future. Question #2: This one is simpler, I'm just rusty with the graphing functions. The scenario is that I have a graph like the following: John 4 Mary 2 Mary 10 Pete 15 John 7 Mary 12 How do I end up with a graph that shows users on the bottom and their total pages printed on the left? For example, going across the X axis we'd have John with 11 pages, Pete with 15 pages, and Mary with 24 pages. Thanks for your help everyone. I like manipulating spreadsheets, but I'm bad about remembering how to create formulas. Does anyone have a good site for learning this stuff?
_________________________
Matt
|
Top
|
|
|
|
#300954 - 27/07/2007 13:55
Re: Excel help
[Re: Dignan]
|
veteran
Registered: 25/04/2000
Posts: 1529
Loc: Arizona
|
If you have the same text string for each (Pages Printed:) that you want trimmed, you can do a: Code:
=RIGHT(A1, LEN(A1) - 14)
The A1 was my test cell and the 14 is the number of characters until the : For the graphs, are the columns split such as name in one and the number in the other?
|
Top
|
|
|
|
#300955 - 27/07/2007 15:00
Re: Excel help
[Re: Dignan]
|
carpal tunnel
Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
|
Quote: My office manager is trying to figure out who's utilizing our color printer the most,
Oh my God, that is the most pointy-haired thing I've ever heard.
My solution to your problem is to find some bright shiny object with which to distract your office manager. Wave it around and toss it out the door. They'll chase it and forget about the color printer thing.
God I hate micromanagement, that just makes me ill.
|
Top
|
|
|
|
#300956 - 27/07/2007 15:16
Re: Excel help
[Re: Tim]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
I believe that will just leave him with a text value that is "5" or whatever. Assuming he wants to use them as numbers, it would probably make sense to wrap that in a VALUE(): Code:
=VALUE(RIGHT(A1, LEN(A1) - 14))
_________________________
Bitt Faulk
|
Top
|
|
|
|
#300959 - 27/07/2007 16:12
Re: Excel help
[Re: Tim]
|
carpal tunnel
Registered: 08/03/2000
Posts: 12341
Loc: Sterling, VA
|
Quote: For the graphs, are the columns split such as name in one and the number in the other?
Depending on my ability to get the number out of that long string of text, I will end up with two rows of columns that will contain the data that I want to graph. These columns will look like the one I had up above, where one person's name may appear many times. I would want to add up all the pages printed for that one person and graph it against the other users in the list.
And yeah, Tony. It's pretty pointy-haired. But some people are pretty thoughtless about our color printer. For example, they'll decide it's a substitute for a professional print house and they'll print 5000 pages to it. We're not talking about a color copier, it's merely a large HP 5500DN. It can support a large number of users (which it has to as the only color printer for 55 people), but when someone's printing 500 sheets of solid-blue paper, we end up spending a lot on toner, and we usually don't have more than one replacement toner cartridge per color. It's possible that my manager just wants to explain the limitations to the person. We've had very upset attorneys in the past (well, we have them every day...).
_________________________
Matt
|
Top
|
|
|
|
#300960 - 27/07/2007 16:23
Re: Excel help
[Re: Dignan]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Yeah, that's only for that exact string. If the only thing you know is that the number will be at the end and immediately preceded by "Pages printed: ", how about this: Code:
=VALUE(RIGHT(A1,13-FIND(": ",RIGHT(A1,14))))
This assumes that the number is at the end of the text, immediately preceded by ": " (colon space), that it will be the only occurrence of ": " in the last 14 characters of the text (which is safe, assuming it's always preceded by "Pages Printed"), and that the number is less than 13 digits long. This should really be a lot easier. It ought to be: Code:
=VALUE(REGEX("\d+?$", A1))
But Excel's functions are limited.
Edited by wfaulk (27/07/2007 16:36)
|
Top
|
|
|
|
#300961 - 27/07/2007 16:41
Re: Excel help
[Re: Dignan]
|
old hand
Registered: 16/02/2002
Posts: 867
Loc: Oxford, UK
|
Quote: One question: would that formula only work if the cell only contained the string "Pages printed: #"? I should have been more clear about this part, but there's a whole lot of text before that of varying length (file names, etc).
Yes.
This will check for up to 3 digits at the right of a string irrespective of what (if anything) goes before it: Code:
=IF(ISNUMBER(VALUE(RIGHT(A1,1))),IF(ISNUMBER(VALUE(RIGHT(A1,2))),IF(ISNUMBER(VALUE(RIGHT(A1,3))),VALUE(RIGHT(A1,3)), VALUE(RIGHT(A1,2))),VALUE(RIGHT(A1,1))),0)
|
Top
|
|
|
|
#300962 - 27/07/2007 18:23
Re: Excel help
[Re: wfaulk]
|
carpal tunnel
Registered: 08/03/2000
Posts: 12341
Loc: Sterling, VA
|
Thanks, Andrew, but I went with Bitt's because it was shorter. That worked! Thanks to everyone for your help.
Any ideas on the graphing part?
_________________________
Matt
|
Top
|
|
|
|
#300963 - 27/07/2007 18:48
Re: Excel help
[Re: Dignan]
|
carpal tunnel
Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
|
Well, you have to get it in a more normalized form first. You could use DSUM() to add the matching values up for you, but you'd still have to know each of the names beforehand, and I can't think of any way to do that. I don't think that Excel provides a way to put values in multiple cells with a single function, which is what you'd have to do in order to get all the unique names. Perhaps there's some VB something you could do within Excel, though.
_________________________
Bitt Faulk
|
Top
|
|
|
|
#300964 - 27/07/2007 20:31
Re: Excel help
[Re: wfaulk]
|
addict
Registered: 11/01/2002
Posts: 612
Loc: Reading, UK
|
If people want to do this kind of thing - perl, awk, grep etc are all available on windows via cygwin.
They would have made light work of some of the pre-processing and allowed Excel to do the presentation....
Obviously 'job done' now - but it may be worth considering adding a few tools to your quiver.
_________________________
LittleBlueThing
Running twin 30's
|
Top
|
|
|
|
#300965 - 27/07/2007 23:04
Re: Excel help
[Re: Dignan]
|
old hand
Registered: 16/02/2002
Posts: 867
Loc: Oxford, UK
|
Quote: Any ideas on the graphing part?
Graphing isn;t my thing but it should be pretty trivial, if not redundant, once you have a properly summed list of users versus print counts.
This pictorial example will give you the per-user summary:
NB. The range name you set in Step2 is the name you need in the formula in Step3.
Attachments
302051-excel-example-empegbbs.gif (88 downloads)
Edited by AndrewT (27/07/2007 23:06)
|
Top
|
|
|
|
|
|