Vba function - search range for state of completion

jordanbuchan359

New Member
Joined
Jun 15, 2018
Messages
15
Hi,

Hoping you can help out with this.. I'll try and explain it as best I can.

I have a list of completed certifications which I'd like to map to an overall certification.

In the example below, Jake has satisfied the all of the requirements and has been granted the overall certification, whereas Pamela is yet to complete the sub cert AC and hence is not granted the overall certification:

NameSub CertCompleteOverall Cert
JakeAAYesTRUE
JakeABYesTRUE
JakeACYesTRUE
Jake
ADYesTRUE
PamelaAAYesFALSE
PamelaABYesFALSE
PamelaADYesFALSE

<colgroup><col style="mso-width-source:userset;mso-width-alt:3072;width:63pt" width="84"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:2669;width:55pt" width="73"> <col style="mso-width-source:userset;mso-width-alt:3218;width:66pt" width="88"> </colgroup><tbody>
</tbody>

The data range could potentially be quite large (several thousand rows) and would cover a multitude of certifications. I'm unsure on what approach to take, any assistance would be greatly appreciated. I apologise if this request exceeds the normal scope of assistance.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Not sure if you need VBA
With Name in column A etc, Try this formula in D2 copied down
=IF(COUNTIFS(A:A,A2,B:B,"AA")+COUNTIFS(A:A,A2,B:B,"AB")+COUNTIFS(A:A,A2,B:B,"AC")+COUNTIFS(A:A,A2,B:B,"AD")=4,TRUE,FALSE)

This will only work if there are 4 certificates that always apply to all
 
Last edited:
Upvote 0
You could use sub cert in columns instead, then you'd need just one row per student, with a column at the end for Overall cert with the following formula.


Book1
DEFGHI
4NameAAABACADComplete
5JakeYesYesYesYesYes
6PamelaYesYesYesNoNo
Sheet1
Cell Formulas
RangeFormula
I5=IF(COUNTIF(E5:H5,"No"),"No","Yes")
 
Upvote 0
Thanks for your replies, unfortunately neither of the methods will work. The data is pulled as a report in the format from my original post. The number of sub certifications to acheive overall certification wont always be four... for example, History may require 2, maths 4 and Art 5.

Ideally, I'd like VBA to run a check of the data and return a value somewhere else in the sheet... something like this:

Overall completion
StudentMathHistoryArt
JakeTRUETRUEFALSE
PamelaFALSETRUETRUE

<tbody>
</tbody>
 
Upvote 0
You could create
- a named range for each subject detailing which certifications are required for that subject
- a table detailing which subjects each student is taking

Those could then be looked up, in conjuntion with your data, to create your table of overall completion

Does your data really look like this? Or does Sub Cert contain the subject name?
NameSub Cert
CompleteOverall Cert
JakeAA
YesTRUE
JakeAB
YesTRUE
JakeAC
YesTRUE
JakeAD
YesTRUE
PamelaAA
YesFALSE
PamelaAB
YesFALSE
PamelaAD
YesFALSE

<tbody>
</tbody>
 
Upvote 0
So your initial table isn't the full data? The subject is included as well? Without it you can't reference the grades needed.
 
Upvote 0
Yongle, Reggie,

Apologies, It seems my oversimplification only made things harder to understand. Here's a better representation:

Full NameModule NameLearner Status
AlexHistory - 1Complete
AlexHistory - 2Complete
AlexMath - 1 Complete
AlexMath - 2Complete
AlexMath - 3Complete
AlexMath - 4Complete
PamelaHistory - 1Complete
PamelaHistory - 2Complete
PamelaMath - 1 Complete
PamelaMath - 2Complete
PamelaMath - 3Complete

<colgroup><col style="mso-width-source:userset;mso-width-alt:3035;width:62pt" width="83"> <col style="mso-width-source:userset;mso-width-alt:3986;width:82pt" width="109"> <col style="mso-width-source:userset;mso-width-alt:3620;width:74pt" width="99"> </colgroup><tbody>
</tbody>

The data dump only contains completed modules - for example in the table above Pamela is missing math - 4. I do have a seperate list of all module offerings, which I could use to create named ranges. I've also created a userform which populates an expected subject table. The only thing I'm missing is how to reference actual vs expected.

Oh, and the learner status column only applies to the individual module, not the overall subject.

Thanks for the help btw!
 
Upvote 0
ok - that makes life easier
Can you check all module names and confirm that none of them contain more than one hyphen (if that is so, can use it to strip out subject name)
 
Upvote 0
All of the module names contain more than one hyphen (Another simplifcation.. my bad). All of the names begin with the following format "UK-STD-" followed by the subject and module. e.g.

UK-STD-Maths Algebra
UK-STD-History B

Etc..
 
Upvote 0
Thanks - I will get back to this AFTER the England football match! And will post a suggestion either later today or tomorrow morning

In principle we need a look-up table - so that the module name can provide the subject and the number of modules per subject

Do you already have such a table in the workbook?
- if you do, post the first few rows so that I can see exactly what it looks like
- if not, I will think of the easiest way to lay one out to keep formulas simple etc
 
Upvote 0

Forum statistics

Threads
1,214,553
Messages
6,120,179
Members
448,948
Latest member
spamiki

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