One example would be finding the patients with...
What you describe is really finding all patients in the specified age range and then sorting them into two groups::those that have at least one visit where the reason for the visit was arthritis.
First, take at least a quick look at the scripted find examples at: Scripted Find Examples
What I am describing follows the pattern set down in those simple find scripts.
You can use two global fields, gCondition and gAge for a scripted find and sort.
Define a calculation field, cHasCondition that uses gCondition to return a 1 if at least 1 related visit record was for the specified condition. The precise syntax of that calculation depends on what field or fields in the Visits table would contain data that identifies the reason for the visit.
You would enter an age or range of ages in gAge and your script would then perform a find to find all patients in that age range. Then it would sort your records by cHasCondition to sort them into the two groups. A sub summary layout part (when sorted by gHasCondition), can be used to split the resulting list of records into two groups and a summary field can give you the number of records in each group.
You may find this old but still relevant post on summary reports helpful: Creating Filemaker Pro summary reports--Tutorial