简体   繁体   中英

How to get formula based on current filter with EXCEL?

I have an excel file. I filtered cell according to my conditions.

I could have done this with formulas also by typing IFs.

Rather than typing this formula, is there a way to generate this formula from existing filter?

By this way, I don't have to type a lot of IF statements by hand.

Example

在此处输入图片说明

Let's say I filtered this table with conditions age=3 color=Black body_mark=Star

I could do this just by filtering.

However, I want to create a formula with this and just paste to cell.

By this way, I can use different conditions in different cells.

Apart from that with this formula I want to take TOTAL AGE.

SUMIF( range, criteria, [sum_range] )

If you use following formula for one criterion:

SUMIFS("B2:B17",3,"B2:B17") it will give you total age for all horses with age = 3

In your case use the following SUMIFS to to get total age with multiple criteria age = 3, colour = black...etc

SUMIFS("B2:B17","B2:B17",3,"C2:C17","Black","D2:D17","Star") 

Let me explain, Assume your B2:B17 has age listed for all horses. C2:C17 for colour and D2:D17 for body mark. So you want to get total age satisfying conditions for all three columns. That's what the SUMIFS() does here.

Is that what you are looking for?

Take a look at this article : SumIfs() web resources for further understanding.

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