Omega Owners Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to OOF

Pages: [1] 2 3  All   Go Down

Author Topic: Any MS Excel experts in here?  (Read 3562 times)

0 Members and 1 Guest are viewing this topic.

TheBoy

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Brackley, Northants
  • Posts: 107026
  • I Like Lockdown
    • Whatever Starts
    • View Profile
Any MS Excel experts in here?
« on: 25 June 2014, 17:48:38 »

Bloody Excel, office tosser's tool. I'm rubbish at it. But the managers want their pretty pictures

Have a Worksheet with Date, Name, Type and a Yes/No columns.  To make it easier to clarify, lets pretend its OOF, and what sections current and future mods visit - so my worksheet may look like:

DATE    Name         Section      ActionDone
1/4/14 KevinWood  GenChat    Yes
6/4/14 TheBoy        GenChat   No
6/4/14 TheBoy        FAQ          No
8/4/14 MDTM          Newbie     Yes
9/4/14 Hotel21        Newbie     No
21/4/14 TheBoy      CarChat     Yes
5/5/14 Hotel21       GenChat     Yes
5/5/14 AA              GenChat     No


You get the idea :)

From this, I need to create the following columns:
Name
Number of times name appears
Number of times name appears with Action=Yes
Number of time name appears in last 30 days
Number of time name appears in last 30 days with Action=Yes

(I'll prob need to add additional time options). From this, I should be able to create the pretty graphs that mgmt will drowl over, but ultimately ignore what its telling them.

TIA for any pointers.
Logged
Grumpy old man

TheBoy

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Brackley, Northants
  • Posts: 107026
  • I Like Lockdown
    • Whatever Starts
    • View Profile
Re: Any MS Excel experts in here?
« Reply #1 on: 25 June 2014, 17:51:49 »

I'll add, I've currently got the names and type cells built as dropdowns from a Named List on another worksheet, so a) its consistent (but adjustable), and b) may be easier to use to build and calculations?
Logged
Grumpy old man

tunnie

  • Get A Life!!
  • *****
  • Offline Offline
  • Gender: Male
  • Surrey
  • Posts: 37573
    • Zafira Tourer & BMW 435i
    • View Profile
Re: Any MS Excel experts in here?
« Reply #2 on: 25 June 2014, 17:52:59 »

Use Frequency?  Done similar, recall basic freq wizard did the job :-\
Logged

TheBoy

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Brackley, Northants
  • Posts: 107026
  • I Like Lockdown
    • Whatever Starts
    • View Profile
Re: Any MS Excel experts in here?
« Reply #3 on: 25 June 2014, 17:53:23 »

Can you fire SQL commands into Excel - this has to be a standalone Workbook, not linking to any other files.

I could do it in SQL commands :)
Logged
Grumpy old man

TheBoy

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Brackley, Northants
  • Posts: 107026
  • I Like Lockdown
    • Whatever Starts
    • View Profile
Re: Any MS Excel experts in here?
« Reply #4 on: 25 June 2014, 17:54:41 »

Use Frequency?  Done similar, recall basic freq wizard did the job :-\
There was some issue around doing the dates when I played earlier today, then I got sidetracked onto Pivot Tables, and lost 3 hours of my life without achieving anything useful.
Logged
Grumpy old man

Bigron

  • Omega Baron
  • *****
  • Offline Offline
  • Gender: Male
  • Witham, Essex
  • Posts: 4808
    • Omega 2.6 V6 Auto '51 Reg
    • View Profile
Re: Any MS Excel experts in here?
« Reply #5 on: 25 June 2014, 18:01:28 »

TB, can you tell me exactly what data you are needing to process, if it doesn't breach Company Confidentiality?
Excel and I are old enemies, with which I have battled often and won sometimes!
If you are able to send me the raw data I will do battle on your behalf and may even be able to end up with a pretty chart? 8)
It would please me to be able to repay some of the great things OOF have done for me, as another member posted earlier.

Ron.
Logged

TheBoy

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Brackley, Northants
  • Posts: 107026
  • I Like Lockdown
    • Whatever Starts
    • View Profile
Re: Any MS Excel experts in here?
« Reply #6 on: 25 June 2014, 18:12:12 »

Its confidential, but the example above should give the idea...
Logged
Grumpy old man

jimbobmccoy

  • Intermediate Member
  • ***
  • Offline Offline
  • Gender: Male
  • outer london
  • Posts: 311
    • View Profile
Re: Any MS Excel experts in here?
« Reply #7 on: 25 June 2014, 19:14:58 »

Sounds like the countif function is what you need.

Essentially counts number of times a value appears in a range if it meets your criteria.

I'll have a proper look a bit latter if still  needed.

Alternatively-script a query to import the excel in to a SQL DB on a schedule, then update the needed columns that exist in the table with the info you need and push out to csv, again scheduled.

You can then just set a macro to run text to columns, save as xls, and you're done.
Completely arse about face, but as I generally detest excel, it's stupid language and lack of ability to do what SQL does, I have done this before. (Albeit on a more complex requirement) (and yes, I'm choosing to completely ignore excel is not meant to be access, SQL or any other form of DB :y)
Logged

TheBoy

  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
  • Brackley, Northants
  • Posts: 107026
  • I Like Lockdown
    • Whatever Starts
    • View Profile
Re: Any MS Excel experts in here?
« Reply #8 on: 25 June 2014, 19:18:20 »

Importing into a DB is a no-go I'm afraid. That was the way I wanted to go.
Logged
Grumpy old man

cem_devecioglu

  • Guest
Re: Any MS Excel experts in here?
« Reply #9 on: 25 June 2014, 19:26:46 »

I'n not an excel expert ,  but  you can use visual basic macros in excel .please have a look at this page  :y


http://www.excel-easy.com/vba/workbook-worksheet-object.html


and this one
http://www.excel-vba.com/vba-prog-1-1-editor.htm


main page
http://www.excel-vba.com/excel-vba-contents.htm


ps: I would also transport it into sql  ;D



« Last Edit: 25 June 2014, 19:28:49 by cem »
Logged

Gaffers

  • Omega Queen
  • *****
  • Offline Offline
  • Gender: Male
  • NE Hampshire/Surrey
  • Posts: 11322
    • Ford Ranger Wildtrak
    • View Profile
Re: Any MS Excel experts in here?
« Reply #10 on: 25 June 2014, 19:28:09 »

You need to use the COUNTIF function :y

http://office.microsoft.com/en-001/excel-help/count-how-often-a-value-occurs-HP001127779.aspx

Edit:  you can nest the COUNTIFs with IF statements as required
« Last Edit: 25 June 2014, 19:30:01 by Monsieur Guffer »
Logged

cem_devecioglu

  • Guest
Re: Any MS Excel experts in here?
« Reply #11 on: 25 June 2014, 19:30:16 »

also within usual vb, you can create excel object ,  open the excel sheet and work with columns like any variable :y


just add the excel object class from objects/references then
Dim xl As New Excel.Application
Dim xlsheet As Excel.Worksheet
Dim xlwbook As Excel.Workbook
Private Sub Command1_Click()
Text1.Text = xlsheet.Cells(2, 1)
Text2.Text = xlsheet.Cells(2, 2)
xl.ActiveWorkbook.Close False, "c:\book1.xls"

xl.Quit
End Sub
Private Sub Command2_Click()
xlsheet.Cells(2, 1) = Text1.Text
xlsheet.Cells(2, 2) = Text2.Text
xlwbook.Save
xl.ActiveWorkbook.Close False, "c:\book1.xls"
xl.Quit
End Sub
Private Sub Form_Load()
Set xlwbook = xl.Workbooks.Open("c:\book1.xls")
Set xlsheet = xlwbook.Sheets.Item(1)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set xlwbook = Nothing
Set xl = Nothing
End Sub
« Last Edit: 25 June 2014, 19:37:33 by cem »
Logged

jimbobmccoy

  • Intermediate Member
  • ***
  • Offline Offline
  • Gender: Male
  • outer london
  • Posts: 311
    • View Profile
Re: Any MS Excel experts in here?
« Reply #12 on: 25 June 2014, 19:31:19 »

Also, you may need the IF function, the countifs function and possibly nested IF's.
You can also use a countif as your true or false part of the if function.

So you could say, if my cell has value x then count how many yes's and if it doesn't return text "no value.

The thing to remember-it's excel so is almost always the opposite logic or natural inclination to SQL. And it's designed to screw with any sane persons brain
 :D
Logged

jimbobmccoy

  • Intermediate Member
  • ***
  • Offline Offline
  • Gender: Male
  • outer london
  • Posts: 311
    • View Profile
Re: Any MS Excel experts in here?
« Reply #13 on: 25 June 2014, 19:32:55 »

You need to use the COUNTIF function :y

http://office.microsoft.com/en-001/excel-help/count-how-often-a-value-occurs-HP001127779.aspx

Edit:  you can nest the COUNTIFs with IF statements as required

I Must type faster!
Logged

jimbobmccoy

  • Intermediate Member
  • ***
  • Offline Offline
  • Gender: Male
  • outer london
  • Posts: 311
    • View Profile
Re: Any MS Excel experts in here?
« Reply #14 on: 25 June 2014, 19:35:06 »

Importing into a DB is a no-go I'm afraid. That was the way I wanted to go.

Can you not stick sqlexpress on your own machine, create a one table DB and do it locally on that?

Will anyone mind as long as the output is right?

Also, from experience, management tend to want this type of report to grow-get more complex, analyse the same thing more times, and still not get what it's telling them. As this happens having the info in a proper DB would be a huge help
Logged
Pages: [1] 2 3  All   Go Up
 

Page created in 0.011 seconds with 17 queries.