Forum Discussion
Using X-lookup within a Countifs function
I'm unsure if this is the right approach, but I want to be able to use a combination of countifs and xlookup, or vlookup, to check cells in column C to column G for employees that are working (indicated by "D") who are also a specific trade (electrician in this example). I want to be able to search an employee trade table to so that trades can be reassigned in another worksheet, and I want to be able to reference a trade table so different workforces can be references in the countifs.
I'm able to get it to work by creating the spill first with xlookup to pull in their trades, and then using countifs with the spill and the row that indicates if they're working to count the number of electricians working, but I'd like to the entire setup in a single function in the last column of the table.
I feel like this should be straight forward, but I can't seem to figure it out. Any help would be greatly appreciated! See below.
Thanks!
How about this:
=SUMPRODUCT((XLOOKUP(A2:A30, TradeTable!A:A, TradeTable!B:B, "")="Electrician") * (C2:G30="D"))