State Level Dynamic Count

lizardbreath

Board Regular
Joined
Feb 23, 2012
Messages
54
Hello,

I will do my best to explain what I am looking to do.

1) Column A has a person's name
2) The top columns have all 50 states
3) The states that the people have licenses in will have an "x" in them.

So it would look something like this

CAAZFLORNV
Betty SueXXX
Alert EinsteinXX
George BushX
Weighted Total1.580.50.330.33

<tbody>
</tbody>


What I am trying to do is derive an excel calculation (Or VBA function) that looks at all of the licenses that have an "x" in them for that 1 person. Then it takes 1 and divides it by the number of licenses with the X and that assigns a value for each of the licenses for that person.

As an example looking at Betty Sue in the image above. She has 3 licenses in CA, FL, and NV. If we took her 1 and divide it by 3 (for her 3 licenses), each of the states are given a weight of .33

For Albert Einstein he has an X in CA & AZ. So if you 1 and divide it by his two states, it gives them both a .5 weight. So CA & AZ would be allocated a weight of .5

Is this possible in excel?
 
Last edited:

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
wouldn't that suggest then that Betty Sue has more licences, but gets weighted lower than Albert ??
And George Bush would be even Higher !!
Having said that

Excel 2007
ABCDEFGH
1NameCAAZFLORNV
2Bettyxxx0.333333
3Albertxx0.5
4Georgex1
5
Sheet1
Cell Formulas
RangeFormula
G2=1/COUNTIF(B2:F2,"x")
G3=1/COUNTIF(B3:F3,"x")
G4=1/COUNTIF(B4:F4,"x")
 
Last edited:
Upvote 0
Assuming that the "X" values are entered manually (that is, not the result of a formula), is this what you mean?
H2 copied down, B5 copied across.

Excel Workbook
ABCDEFGH
1CAAZFLORNV
2Betty SueXXX0.33333
3Alert EinsteinXX0.5
4George BushX1
51.830.50.3300.33
State Count
 
Upvote 0
wouldn't that suggest then that Betty Sue has more licences, but gets weighted lower than Albert ??
And George Bush would be even Higher !!
Having said that
Excel 2007
ABCDEFGH
1NameCAAZFLORNV
2Bettyxxx0.333333
3Albertxx0.5
4Georgex1
5

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
G2=1/COUNTIF(B2:F2,"x")
G3=1/COUNTIF(B3:F3,"x")
G4=1/COUNTIF(B4:F4,"x")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Yes that is correct. The way that this would be used is slightly different than most use cases. But basically we have caps hear. So when you have more licenses it means that the "cap" can be taken up by other licenses; making the license you have less effective.



I really appreciate the work from both of you, I will test these out and let you know how it goes!
 
Upvote 0

Forum statistics

Threads
1,214,808
Messages
6,121,686
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top