-
WSeschwab
AskWoody LoungerFor Age 0 and Category = “A”:
=MEDIAN(IF(($A$2:$A$140)*($B$2:$B$14=”A”),$A$2:$A$14))
as an array formula (confirm with Ctrl+Shift+Enter). Adjust the ranges as needed.
Thank you! I was missing the asterisk * and Excel didn’t like that.
-
WSeschwab
AskWoody LoungerNovember 10, 2008 at 11:39 am in reply to: Generate data on 1 worksheet from 2 others (2007/SP1) #1132002Yes, I can use Access. I’ll try that. Thanks for the suggestion. I suspect I’ll visit you again in the Access forum.
-
WSeschwab
AskWoody LoungerGot it. Thanks. Erik
-
WSeschwab
AskWoody LoungerOne last (?!) question. In the SQL — or elsewhere — can I specify that VisitDate should be in date format? Right now it comes out 39084 etc. I tried to specify date format in the query’s Design View (Properties, Format) but Date wasn’t one of the options available (general number, currency, Euro etc.)
Here is the SQL:
SELECT qryParticipantsFirstVisitChooseDateChooseSite.unitID, qryParticipantsFirstVisitChooseDateChooseSite.protocol, qryParticipantsFirstVisitChooseDateChooseSite.ParticipantID, qryParticipantsFirstVisitChooseDateChooseSite.EnrollmentDate, Int([FirstVisitDate]) AS VisitDate
FROM qryParticipantsFirstVisitChooseDateChooseSite
WHERE (((Val(DCount(“*”,”qryParticipantsFirstVisitChooseDateChooseSite”,”UnitID=” & Chr(34) & [UnitID] & Chr(34) & ” AND FirstVisitDate<=#" & Format([FirstVisitDate],"mm/dd/yyyy hh:nn:ss") & "#")))<=20))
ORDER BY qryParticipantsFirstVisitChooseDateChooseSite.unitID, Int([FirstVisitDate]);Thanks,
Erik -
WSeschwab
AskWoody LoungerA dirty trick is the best kind of trick!
Thanks.
One good lesson for me is to remember the connection between “tie” and “rank”…
-
WSeschwab
AskWoody LoungerThanks for the instructions. Database, stripped & zipped, is attached.
-
WSeschwab
AskWoody LoungerHans–if you have time to look at it, my data is attached…disguised everything except the dates, but consistently.
Excel file with one worksheet of data per query. SQL of each query is in a text box on the respective worksheet. My question is why the second query yields 15 records and not 20.
With many thanks in advance,
Erik -
WSeschwab
AskWoody LoungerIf I can figure out how best to anonymize it (without destroying my problem!) I’ll post an example. But in any event I really appreciate your guidance thus far.
-
WSeschwab
AskWoody LoungerLOL, that was my first thought too. But no, I’ve rechecked the data and there were 119 unique participants.
-
WSeschwab
AskWoody LoungerSorry, one more question:
When I modify qryParticipants to restrict to only one clinic, the second query returns only 15 records, not 20 (although the first query returns 119 records). Do you know why this is? Here is the modified qryParticipants:
SELECT tblVisits.unitID, tblVisits.ParticipantID, Min(tblVisits.CompletedVisitDate) AS FirstVisitDate
FROM tblVisits
WHERE (((tblVisits.CompletedVisitDate)>=#1/1/2007#))
GROUP BY tblVisits.unitID, tblVisits.ParticipantID
HAVING (((tblVisits.unitID)=”052-001″));Thanks again–
Erik -
WSeschwab
AskWoody LoungerThat did it!
HansV, many thanks again for your time and magic.
Erik
-
WSeschwab
AskWoody LoungerCompletedVisitDate is Date/Time (as expected) but unitID is text — a typical value is 034-001, with the hyphen in the middle. Can the query handle text, or should I add a field for numeric IDs to my units table?
Thanks
-
WSeschwab
AskWoody LoungerThanks — safe to say I’d have never come up with this on my own…
But there’s a problem. Working with my data, the first query returns 1914 results…but so does the second query. The problem seems to be somewhere in
Val(DCount(“*”,”qryParticipants”,”unitID=” & [unitID] & ” AND FirstVisitDate<=#" & Format([FirstVisitDate],"mm/dd/yyyy") & "#"))
because I exposed it as a field and the value was 0 every time (not 1-20 for each unitID as I expected…and as it comes back in your example). I know it's hard to diagnose without seeing my data, but do you know why that kind of thing might happen?
Thanks again
Erik -
WSeschwab
AskWoody LoungerI was afraid you’d say that.
Thanks for the advice.
-
WSeschwab
AskWoody LoungerPlease disregard this problem. My mistake.
Sincerely,
Erik “Think Before You Post” Schwab
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
2 hours, 9 minutes ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
3 hours, 25 minutes ago -
The story of Windows Longhorn
by
Cybertooth
3 hours, 55 minutes ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
5 hours, 24 minutes ago -
Are manuals extinct?
by
Susan Bradley
30 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
14 hours, 32 minutes ago -
Network Issue
by
Casey H
1 hour, 37 minutes ago -
Fedora Linux is now an official WSL distro
by
Alex5723
1 day, 2 hours ago -
May 2025 Office non-Security updates
by
PKCano
1 day, 2 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
1 day, 4 hours ago -
pages print on restart (Win 11 23H2)
by
cyraxote
5 hours, 46 minutes ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
1 day, 7 hours ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
1 day, 7 hours ago -
Proton to drop prices after ruling against “Apple tax”
by
Cybertooth
1 day, 14 hours ago -
24H2 Installer – don’t see Option for non destructive install
by
JP
6 hours, 51 minutes ago -
Asking Again here (New User and Fast change only backups)
by
thymej
2 days, 1 hour ago -
How much I spent on the Mac mini
by
Will Fastie
1 day, 1 hour ago -
How to get rid of Copilot in Microsoft 365
by
Lance Whitney
4 hours, 52 minutes ago -
Spring cleanup — 2025
by
Deanna McElveen
2 days, 7 hours ago -
Setting up Windows 11
by
Susan Bradley
1 day, 2 hours ago -
VLC Introduces Cutting-Edge AI Subtitling and Translation Capabilities
by
Alex5723
2 days, 3 hours ago -
Powershell version?
by
CWBillow
2 days, 4 hours ago -
SendTom Toys
by
CWBillow
14 hours, 52 minutes ago -
Add shortcut to taskbar?
by
CWBillow
2 days, 7 hours ago -
Sycophancy in GPT-4o: What happened
by
Alex5723
3 days ago -
How can I install Skype on Windows 7?
by
Help
2 days, 23 hours ago -
Logitech MK850 Keyboard issues
by
Rush2112
2 days, 5 hours ago -
We live in a simulation
by
Alex5723
3 days, 14 hours ago -
Netplwiz not working
by
RetiredGeek
3 days, 1 hour ago -
Windows 11 24H2 is broadly available
by
Alex5723
4 days, 2 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.