PC Review


Reply
Thread Tools Rate Thread

How to build macro to do calculations by grouping column A by name

 
 
J.J.
Guest
Posts: n/a
 
      17th Feb 2009
Within this worksheet, I have 4 columns

Company Name #logs Boardmember
ABC Luis 1 yes
ABC Anne 1 yes
ABC Mary 9 yes
XYZ John 1 yes
XYZ Grace 4 no
XYZ Ben 8 yes
345 Erin 2 no
345 Kate 0 no
345 Greg 0 no

What I want to solve for is-
Board member Usage (#boardmembers with logs per company>1/
#boardmembers per company)
Non Board member usage (#nonboardmembers with logs>1 per company/
#boardmembers per company)

For example,
Usage
---------
Team ABC usage = 33%
Team XYZ usage = 66%
Team 345 usage = 100%

Is there a way to do this in a macro? My main problem is finding a way
calculate by company name. Any help would be great
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      17th Feb 2009
Hi,

Your pseudo formula is

nonboardmembers with logs>1 per company/boardmembers per company

so for ABC

> ABC Luis 1 yes
> ABC Anne 1 yes
> ABC Mary 9 yes


3 board members with 1 greater than 1 so your answer of 33% seems to agree
with your pseudo formula

However, Group XYZ

> XYZ John 1 yes
> XYZ Grace 4 no
> XYZ Ben 8 yes


evaluates as 1/2= 50% according to your pseudo code.

or if you mean NON board members
1/1=100%

I can't get 66% out of this

please clarify

Mike



"J.J." wrote:

> Within this worksheet, I have 4 columns
>
> Company Name #logs Boardmember
> ABC Luis 1 yes
> ABC Anne 1 yes
> ABC Mary 9 yes
> XYZ John 1 yes
> XYZ Grace 4 no
> XYZ Ben 8 yes
> 345 Erin 2 no
> 345 Kate 0 no
> 345 Greg 0 no
>
> What I want to solve for is-
> Board member Usage (#boardmembers with logs per company>1/
> #boardmembers per company)
> Non Board member usage (#nonboardmembers with logs>1 per company/
> #boardmembers per company)
>
> For example,
> Usage
> ---------
> Team ABC usage = 33%
> Team XYZ usage = 66%
> Team 345 usage = 100%
>
> Is there a way to do this in a macro? My main problem is finding a way
> calculate by company name. Any help would be great
>

 
Reply With Quote
 
J.J.
Guest
Posts: n/a
 
      18th Feb 2009
Hi Mike, thanks for the reply!

Please let me fix that as it was a mistake.

boardmember usage
------------
Team ABC boardmember usage = 33% (1/3) ;
Team XYZ boardmember usage = 50% (1/2);
Team 345 boardmember usage = undefined (0/0)

Team ABC non boardmember usage = undefined (0/0) ;
Team XYZ non boardmember usage = 100% (1/1);
Team 345 non boardmember usage = 100% (1/1)

I hope this makes sense and that I didn't make another mistake on
this. Please let me know if there is anything else that I need to
explain. Thanks!



On Feb 17, 3:41*pm, Mike H <Mi...@discussions.microsoft.com> wrote:
> Hi,
>
> Your pseudo formula is
>
> nonboardmembers with logs>1 per company/boardmembers per company
>
> so for ABC
>
> > * ABC * * * * * * *Luis * * * 1 * * * *yes
> > * ABC * * * * * * *Anne * * *1 * * * yes
> > * ABC * * * * * * *Mary * * *9 * * * yes

>
> 3 board members with 1 greater than 1 so your answer of 33% seems to agree
> with your pseudo formula
>
> However, Group XYZ
>
> > * XYZ * * * * * * * John * * *1 * * * *yes
> > * XYZ * * * * * * * Grace * *4 * * * *no
> > * XYZ * * * * * * * Ben * * * 8 * * * *yes

>
> evaluates as 1/2= 50% according to your pseudo code.
>
> or if you mean NON board members
> 1/1=100%
>
> I can't get 66% out of this
>
> please clarify
>
> Mike
>
> "J.J." wrote:
> > Within this worksheet, I have 4 columns

>
> > Company * * *Name * *#logs *Boardmember
> > * ABC * * * * * * *Luis * * * 1 * * * *yes
> > * ABC * * * * * * *Anne * * *1 * * * yes
> > * ABC * * * * * * *Mary * * *9 * * * yes
> > * XYZ * * * * * * * John * * *1 * * * *yes
> > * XYZ * * * * * * * Grace * *4 * * * *no
> > * XYZ * * * * * * * Ben * * * 8 * * * *yes
> > * 345 * * * * * * * *Erin * * *2 * * * *no
> > * 345 * * * * * * * *Kate * * 0 * * * *no
> > * 345 * * * * * * * *Greg * * 0 * * * *no

>
> > What I want to solve for is-
> > Board member Usage (#boardmembers with logs per company>1/
> > #boardmembers per company)
> > Non Board member usage (#nonboardmembers with logs>1 per company/
> > #boardmembers per company)

>
> > For example,
> > Usage
> > ---------
> > Team ABC usage = 33%
> > Team XYZ usage = 66%
> > Team 345 usage = 100%

>
> > Is there a way to do this in a macro? My main problem is finding a way
> > calculate by company name. Any help would be great


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grouping and percentage calculations randlesc Microsoft Excel Worksheet Functions 2 29th Mar 2010 10:05 PM
Pivot Tables, Grouping, and Calculations Mike Microsoft Excel Misc 1 9th Feb 2009 03:49 AM
Grouping Calculations Jen Microsoft Access Reports 2 8th Feb 2008 10:31 PM
Report grouping and calculations =?Utf-8?B?QmFnZ2Vy?= Microsoft Access Reports 2 6th Jun 2006 04:48 PM
Report Grouping Calculations Grease Microsoft Access Reports 1 22nd Jun 2004 05:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:24 PM.