I’m trying to use VLOOKUP in an array formula, however it doesn’t work right. My questions are: Can it be made to work, if so, how? if not, what alternative is there to this approach. Please see attachment
Thanks,
Ken
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » VLookup in Array Formula (XL2KSR1)
ken
I suspect that it has become way too complex for easy analysis.
My assumption is that VLOOKUP decides that (even with array formulae) its job is to find the first item and then stop.
I had difficulty understanding why it had to be done in quite that way.
What was wrong with doing the VLOOKUPS in cells B8:B13 and then using the resulting single answers in a simple construct? It would certainly be easier to debug.
I enjoyed discovering your method of rangenaming CCs – nice one (I always wondered how to make robust definitions)
Andrew O
I agree with Andrew, and to detail what he alluded to:
In B8:B13 you would have the lookups:
=VLOOKUP(A8,CCs,2,0)
Name B8:B13 LookupMyList
and then use as ARRAY formula:
=SUM(IF(ISERROR(LookupMyList),0,IF(LookupMyList=$A$1,0,1)))
It adds an extra column, but that shouldn’t be a big deal.
You could even get rid of the array formula by using in B8:B13:
=VLOOKUP(A8,CCs,2,0)$A$1
and using the formula:
=COUNTIF(LookupMyList,TRUE)
I think that the problem is (as you noticed) that VLOOKUP is NOT an ARRAY formula. The command:
VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)
Assumes that lookup_value is a single value. If it is a range, it uses the top-left value of the range. Even if this is ARRAY entered it ALWAYS and ONLY looks at the TopLeft value.
Steve
Thanks to all who answered my post. Adding an additional column is not an option that I wish to use because this example is cut down from a form that I use. To start adding column(s) would require a lot of reworking of macros and the form itself (although I suppose I could use a hidden column). Anyway Aladin nailed it for me. Thanks Aladin.
Ken
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.
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.
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.