Mar 13 2024 03:03 AM - edited Mar 13 2024 03:20 AM
Hello, I am trying to get a formula that will lookup a criteria in one column and then return value in another column if that too matches a second criteria. How do I do this? Thanks
Mar 13 2024 03:19 AM
@TP700I have attached an example version of this is my file to visualise what I need it to do
Mar 13 2024 03:23 AM
Mar 13 2024 03:32 AM
Hi Peter, I can't send my actual working file as it contains sensitive data, so I've put more information into my example file to show what I mean. Thanks
Mar 13 2024 04:03 AM
A formula you might care to try is
= COUNTIFS(uniqueCode, uniqueCode, type, "Type1")
where, hopefully, the defined names are obvious. With 365 the formula should spill to the entire column.
Mar 13 2024 04:08 AM
Depends on in which form you'd like to have the result. As variant
with
=LET(
types, TOROW(SORT(UNIQUE(type))),
codes, SORT(UNIQUE(code)),
VSTACK(
HSTACK("",types),
HSTACK(codes,
MMULT(--(TRANSPOSE(TOROW(codes)=code)),
--(type=types))
)
)
)
Mar 13 2024 03:34 PM
Agreed, there are better layouts. To be told in triplicate that there are three occurrences would seem to be excessive. Mind you, your skills are soon to be overtaken by
= PIVOTBY(uniqueCode, type, type, COUNTA, ,0, ,0)
Mar 14 2024 02:41 AM
So far I don't use these two aggregation functions due to compatibly. Played a bit and keep for the future.
Mar 14 2024 04:13 AM
I see your point.
Perhaps it depends on whether you are writing for the past, present or future!
- Most readers do not like change and will be most comfortable with the past
- The present is the most useful
- The future stretches the imagination
The new functions provide amazing flexibility for pivot-table-like output
Re: Is now the time to abandon the concept of relative referencing? - Microsoft Community Hub
but also can figure in the core calculation task. For me, practice is going to be necessary!
Mar 14 2024 08:32 AM
Major part of what I'm doing I share with other people. Major part of such people are on Current channel. On this resource I assume the same, if only it's not clear from the content that the person is on legacy Excel, actually or mentally. Or, in opposite, on Beta.
Thus the assumption is people are in present. Agree, that's great if someone tries to prepare them for the future.
As for pivoting I still prefer data model based PivotTables. Lot of flexibility, especially with complex models, easier to slice & dice, more flexible formatting. Main cons is Refresh.
For the relatively simple models new functions could be more preferrable. When they are in production.