简体   繁体   中英

Sum column X based on value in column Y not being in array Z

To keep things simple I have 3 columns (place holders used)

X - Contains Revenue Y - Contains a number (hotel room number) Z - Independent list of numbers (room numbers belonging to a certain category)

I'm trying to tally all the revenue in column X for rooms that do not appear in Column Z. Here is my attempt:

=SUMIFS(X2:X2000,Y2:Y2000,"<>"&Z2:Z198)

But that is still totaling all the revenue without the conditional. Pointers?

Try it with a SUMPRODUCT function .

As a standard formula,

=SUMPRODUCT(X2:X2000, --ISERROR(MATCH(Y2:Y2000, Z2:Z198, 0)))

Keep column X and column Y references limited to the actual data but the same size. Column Z should likewise be limited but does not necessarily have to be hte same size. Do not use full column references.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM