Link to home
Start Free TrialLog in
Avatar of Lazarus
LazarusFlag for United States of America

asked on

Excel Formula

Currently I have a formula: =IFERROR((C2)/(B2-F2-G2-H2-I2-J2),"")
A new requirement has been added, I now need to be able to count for D2 as well.
The problem is that if B2=1 and C2=1, I get 100% which is correct, but if I count D2 as well it will give me 50%. I need to be able do something will only count C2 or D2 but not both. B2 changes based on how many students.

B2 comes from: =COUNTIF('PTA Credential '!A:A,A2)
C2 comes from: =SUMPRODUCT((fm=Counts!A2)*(fm_0=1))
D2 comes from: =SUMPRODUCT((fm=Counts!A2)*(fm_1=1))

If I use:  =IFERROR((C2+D2)/(B2-F2-G2-H2-I2-J2),"") instead of 100% it will be 200% which cant be with only 2 students

I'm in over my head on this. It's probably simple, but I havent worked on Excel for a good while.
Template-20180122.xlsm
Avatar of Norie
Norie

What criteria can be used to determine whether to use C2 or D2?
Avatar of Lazarus

ASKER

On the First Sheet (PTA Credential) in the attached sheet, C2 and D2 come from the array based on Columns O and P. The next sheet (Counts) take that info and aggregates those into an overall count.
You say want to use either C2 or D2, how would it be determined which to use?

Is there some criteria/logic for that?
Avatar of Lazarus

ASKER

That is the issue, both can be used for a total of 2, but the formula should can only count it as if its 1. Either/Or but not both. Does that make sense to you?
Avatar of Lazarus

ASKER

The amount of students in the array varies. So if there a 30 students, some may have O2 or P2 or both set as 1on the 1st sheet . The count on the 2nd sheet (COUNTS) - S2  "=IFERROR((C3+D3)/(B3-F3-G3-H3-I3-J3),"") "  should only ever be a max of 100%. That is were the formula comes in. I neglected that in the original write-up.
It makes sense to only use one but I don't see any way of determining which one to use.

Is there any logic/reason why one would be used over the other?
Avatar of Lazarus

ASKER

Yes, They both have to be counted but only one is used for the count its an Either/Or issue.
ASKER CERTIFIED SOLUTION
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lazarus

ASKER

Thank you, I had not even thought to use MIN. This is what I used "=IFERROR(MIN(1,C2+D2)/(B2-F2-G2-H2-I2-J2),"") " and that seems to work well for my issue.
Avatar of Lazarus

ASKER

Opps, doesnt work after all. I need some adjustment.  I'll try to reopen.
The formula, does not account for students B2 that do not have a count in them. B2, is derived from this: "=COUNTIF('PTA Credential '!A:A,A2)"
Avatar of Lazarus

ASKER

I was able to figure it all out and get it working. I had to use more Arrays and utilized the MIN to help with those. I've attached the Spreadsheet if you want to see what was done. Thanks for your help
TEMPLATE-PTA-Tracking-20180123.xlsm