Multiple conditions

jlkirk

Active Member
Joined
May 6, 2002
Messages
328
Office Version
  1. 365
In column A I have various accounts labeled Account A, Account B, Account C, Account D, and Account E, over 250 in number, not in any particular order. In Column B, I have money deposits corresponding to the various accounts listed by dates (the dates in column C). In column D I have text (>50 letters/words) that contain the words "Dividends", "Interest", and "Capital Gains", located at random places within the text.

What I would like to do is list each deposit in each account by the name in column B, by date, in columns D, E, and F. For example, in column D I would like to list the dividends received in account, by date, each dividend deposit, each interest and each capital gains deposit.

Any help?
 
You have the syntax for SUMIFS incorrect.
But you can really do this just by using the helper column I suggested and the AUTOFILTER tool.

It should be something like this:
=SUMIFS(rangetosum, criteriarange1, criteria1, criteriarange2, criteria2,....)
But, SUMIFS criteria conditions are hard to enter with formulas, so the helper column again would come in handy.

so your formula above should be:
=SumIFS(B:B,A:A,"Account A",HelperColumn,"Dividends")

if you don't want to use the helper column then you'll need to use a big formula inside the SUMIFS, and entering search criteria in data entry query cells (in the example below A28 and C28):

Book1
ABCD
1AccountDepositDateText
2B132024-02-03xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
3E172024-02-08xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
4A172024-02-04xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
5E152024-01-28xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
6D112024-02-04xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
7D102024-02-05xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
8C202024-02-07xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
9D192024-02-06xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
10A202024-02-11xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
11E142024-01-28xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
12D102024-02-13xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
13B142024-02-10xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
14A142024-02-12xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
15A202024-01-31xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
16C192024-02-07xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
17C162024-02-13xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
18C162024-02-13xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
19A192024-02-13xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
20A102024-01-28xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
21B172024-01-31xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
22B172024-02-07xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
23E172024-02-11xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
24C182024-01-26xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
25D152024-02-05xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
26A122024-01-31xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
27DataEntry
28ADividends
29A202024-02-11xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
30A192024-02-13xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
31A102024-01-28xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
Sheet4
Cell Formulas
RangeFormula
A29:D31A29=LET( Data,$A$2:$D$26, Accts,$A$2:$A$26, Acct,A28, Type,C28, Desc,$D$2:$D$26, Types,IFS( ISNUMBER(SEARCH("Interest",Desc)),"Interest", ISNUMBER(SEARCH("Dividends",Desc)),"Dividends", ISNUMBER(SEARCH("Capital Gains",Desc)),"Capital Gains", 1,""), FILTER(Data,(Acct=Accts)*(Type=Types),"") )
Dynamic array formulas.
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I also should have mentioned the ADVANCED FILTER TOOL on the data bar as well. That essentially does what the formula I gave you.
It takes some practice getting used to it, but it is probably easier than updating formulas every time you want to look at your data differently.
(and you may not need the helper column).
 
Upvote 0
You have the syntax for SUMIFS incorrect.
But you can really do this just by using the helper column I suggested and the AUTOFILTER tool.

It should be something like this:
=SUMIFS(rangetosum, criteriarange1, criteria1, criteriarange2, criteria2,....)
But, SUMIFS criteria conditions are hard to enter with formulas, so the helper column again would come in handy.

so your formula above should be:
=SumIFS(B:B,A:A,"Account A",HelperColumn,"Dividends")

if you don't want to use the helper column then you'll need to use a big formula inside the SUMIFS, and entering search criteria in data entry query cells (in the example below A28 and C28):

Book1
ABCD
1AccountDepositDateText
2B132024-02-03xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
3E172024-02-08xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
4A172024-02-04xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
5E152024-01-28xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
6D112024-02-04xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
7D102024-02-05xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
8C202024-02-07xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
9D192024-02-06xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
10A202024-02-11xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
11E142024-01-28xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
12D102024-02-13xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
13B142024-02-10xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
14A142024-02-12xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
15A202024-01-31xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
16C192024-02-07xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
17C162024-02-13xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
18C162024-02-13xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
19A192024-02-13xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
20A102024-01-28xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
21B172024-01-31xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
22B172024-02-07xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
23E172024-02-11xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
24C182024-01-26xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
25D152024-02-05xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
26A122024-01-31xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
27DataEntry
28ADividends
29A202024-02-11xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
30A192024-02-13xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
31A102024-01-28xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
Sheet4
Cell Formulas
RangeFormula
A29:D31A29=LET( Data,$A$2:$D$26, Accts,$A$2:$A$26, Acct,A28, Type,C28, Desc,$D$2:$D$26, Types,IFS( ISNUMBER(SEARCH("Interest",Desc)),"Interest", ISNUMBER(SEARCH("Dividends",Desc)),"Dividends", ISNUMBER(SEARCH("Capital Gains",Desc)),"Capital Gains", 1,""), FILTER(Data,(Acct=Accts)*(Type=Types),"") )
Dynamic array formulas.
How about this to capture the dividends deposited into Account A:

=IF(A2<>"Account A",0,SUMIF(D2,"*Dividends*",B2)) in E2 and copied down for every day deposits are made. Column E could then be totaled to come up with the total amount of Dividends deposited into Account A over a period of time. It could then be "filtered" to derive Dividends deposited on individual days.
 
Upvote 0
Why do all the extra work. A framework to get all the data for you has already been created in the LET function. Just update it as your needs dictate:
Sum of A Dividends are highlighted in GREEN:

Book1
ABCD
1AccountDepositDateText
2B1345325xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
3E1745330xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
4A1745326xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
5E1545319xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
6D1145326xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
7D1045327xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
8C2045329xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
9D1945328xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
10A2045333xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
11E1445319xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
12D1045335xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
13B1445332xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
14A1445334xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
15A2045322xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
16C1945329xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
17C1645335xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
18C1645335xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
19A1945335xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
20A1045319xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
21B1745322xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
22B1745329xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
23E1745333xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
24C1845317xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcInterestlmnopqlmnopq
25D1545327xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
26A1245322xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcCapital Gainslmnopqlmnopq
27DataEntry
28ADividends
29A2045333xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
30A1945335xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
31A1045319xyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcxyxabcDividendslmnopqlmnopq
32
33
3449
Sheet1
Cell Formulas
RangeFormula
A29:D31A29=LET( Data,$A$2:$D$26, Accts,$A$2:$A$26, Acct,A28, Type,C28, Desc,$D$2:$D$26, Types,IFS( ISNUMBER(SEARCH("Interest",Desc)),"Interest", ISNUMBER(SEARCH("Dividends",Desc)),"Dividends", ISNUMBER(SEARCH("Capital Gains",Desc)),"Capital Gains", 1,""), FILTER(Data,(Acct=Accts)*(Type=Types),"") )
A34A34=LET( Data,$A$2:$D$26, Accts,$A$2:$A$26, Acct,A28, Type,C28, Desc,$D$2:$D$26, Types, IFS( ISNUMBER(SEARCH("Interest",Desc)),"Interest", ISNUMBER(SEARCH("Dividends",Desc)),"Dividends", ISNUMBER(SEARCH("Capital Gains",Desc)),"Capital Gains", 1,""), SUM(TAKE(FILTER(Data,(Acct=Accts)*(Type=Types),""),,2)) )
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top