Sum up the values from one sheet and add them to another following certain conditions

An Quala

Board Regular
Joined
Mar 21, 2022
Messages
146
Office Version
  1. 2021
Platform
  1. Windows
Hello Everyone, can you please help me with a code that will sum up values based on condition,

Here are the details,
If sheet "Control Panel" Range(A2)=sheet "BOOK1" Range(B) (search in all rows from B2 to B down)
If sheet "Control Panel" Range(B2)=sheet "BOOK1" Range(L) (search in all rows in phrase from B2 to B down) (For example if in Control Panel there is "Apple" then it should consider "Apple Juice" not "Pineapple" in campaign names)
Sum the values of AH, AI, AK, AL AM and AN from BOOK1 and write the summed values in control panel in their corresponding columns,

In control panel, we should be able to add multiple values in Columns A and B,

This is not a very complex program, I might not be able to convey it properly but if you need, I can explain it even in more details, please let me know,

Thank you!

BOOK1

Bulk File 07.06.22.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQAR
1ProductEntityOperationCampaign IdAd Group IdPortfolio IdAd Id (Read only)Keyword Id (Read only)Product Targeting Id (Read only)Campaign NameAd Group NameCampaign Name (Informational only)Ad Group Name (Informational only)Portfolio Name (Informational only)Start DateEnd DateTargeting TypeStateCampaign State (Informational only)Ad Group State (Informational only)Daily BudgetSKUASIN (Informational only)Ad Group Default BidAd Group Default Bid (Informational only)BidKeyword TextMatch TypeBidding StrategyPlacementPercentageProduct Targeting ExpressionResolved Product Targeting Expression (Informational only)ImpressionsClicksClick-through RateSpendSalesOrdersUnitsConversion RateAcosCPCROAS
2Sponsored ProductsCampaign259139068650319Campaign ABCCampaign ABC20220101AUTOenabledenabled1.00Fixed bid000.00%0.000.00000.000.00%0.000.00
3Sponsored ProductsBidding Adjustment259139068650319Campaign ABCenabledFixed bidplacementTop0.00000.00%0.000.00000.000.00%0.000.00
4Sponsored ProductsBidding Adjustment259139068650319Campaign ABCenabledFixed bidplacementProductPage0.00000.00%0.000.00000.000.00%0.000.00
5Sponsored ProductsAd Group259139068650319257847586333260Ad GroupCampaign ABCAd Groupenabledenabledenabled0.50000.00%0.000.00000.000.00%0.000.00
6Sponsored ProductsProduct Ad259139068650319257847586333260103022664986421Campaign ABCAd Groupenabledenabledenabled000.00%0.000.00000.000.00%0.000.00
7Sponsored ProductsProduct Targeting259139068650319257847586333260258946165082246Campaign ABCAd Groupenabledenabledenabled0.500.50close-matchclose-match000.00%0.000.00000.000.00%0.000.00
8Sponsored ProductsProduct Targeting259139068650319257847586333260122119742464495Campaign ABCAd Grouppausedenabledenabled0.500.50loose-matchloose-match000.00%0.000.00000.000.00%0.000.00
9Sponsored ProductsProduct Targeting259139068650319257847586333260237992570050613Campaign ABCAd Grouppausedenabledenabled0.500.50complementscomplements000.00%0.000.00000.000.00%0.000.00
10Sponsored ProductsProduct Targeting259139068650319257847586333260232189701876219Campaign ABCAd Grouppausedenabledenabled0.500.50substitutessubstitutes000.00%0.000.00000.000.00%0.000.00
11Sponsored ProductsCampaign83506138271425142067021504153Campaign ABCCampaign ABCPortfolio DEF20211026MANUALenabledenabled1.00Dynamic bids - down only000.00%0.000.00000.000.00%0.000.00
12Sponsored ProductsBidding Adjustment83506138271425Campaign ABCPortfolio DEFenabledDynamic bids - down onlyplacementProductPage0.00000.00%0.000.00000.000.00%0.000.00
13Sponsored ProductsBidding Adjustment83506138271425Campaign ABCPortfolio DEFenabledDynamic bids - down onlyplacementTop20.00000.00%0.000.00000.000.00%0.000.00
14Sponsored ProductsAd Group8350613827142537578778386913Ad GroupCampaign ABCAd GroupPortfolio DEFenabledenabledenabled0.50000.00%0.000.00000.000.00%0.000.00
15Sponsored ProductsProduct Ad8350613827142537578778386913212342645931017Campaign ABCAd GroupPortfolio DEFenabledenabledenabledSKUABCB0XXXXXXXX000.00%0.000.00000.000.00%0.000.00
16Sponsored ProductsKeyword835061382714253757877838691323992902474108Campaign ABCAd GroupPortfolio DEFenabledenabledenabled0.500.55Keywordsphrase000.00%0.000.00000.000.00%0.000.00
17Sponsored ProductsNegative Keyword8350613827142537578778386913196272291225675Campaign ABCAd GroupPortfolio DEFenabledenabledenabledKeywordsnegativePhrase000.00%0.000.00000.000.00%0.000.00
18Sponsored ProductsNegative Keyword8350613827142537578778386913127314570814065Campaign ABCAd GroupPortfolio DEFenabledenabledenabledKeywordsnegativePhrase000.00%0.000.00000.000.00%0.000.00
19Sponsored ProductsNegative Keyword835061382714253757877838691394457677669792Campaign ABCAd GroupPortfolio DEFenabledenabledenabledKeywordsnegativePhrase000.00%0.000.00000.000.00%0.000.00
20Sponsored ProductsNegative Keyword83506138271425375787783869136340902182616Campaign ABCAd GroupPortfolio DEFenabledenabledenabledKeywordsnegativePhrase000.00%0.000.00000.000.00%0.000.00
21Sponsored ProductsNegative Keyword8350613827142537578778386913200103526221406Campaign ABCAd GroupPortfolio DEFenabledenabledenabledKeywordsnegativePhrase000.00%0.000.00000.000.00%0.000.00
22Sponsored ProductsCampaign165707835224571142067021504153Campaign ABCCampaign ABCPortfolio DEF20211214MANUALenabledenabled1.00Fixed bid000.00%0.000.00000.000.00%0.000.00
23Sponsored ProductsBidding Adjustment165707835224571Campaign ABCPortfolio DEFenabledFixed bidplacementProductPage0.00000.00%0.000.00000.000.00%0.000.00
24Sponsored ProductsBidding Adjustment165707835224571Campaign ABCPortfolio DEFenabledFixed bidplacementTop0.00000.00%0.000.00000.000.00%0.000.00
25Sponsored ProductsAd Group16570783522457175645299640614Ad GroupCampaign ABCAd GroupPortfolio DEFenabledenabledenabled0.50000.00%0.000.00000.000.00%0.000.00
26Sponsored ProductsProduct Ad16570783522457175645299640614199462666282967Campaign ABCAd GroupPortfolio DEFenabledenabledenabledSKUABCB0XXXXXXXX000.00%0.000.00000.000.00%0.000.00
27Sponsored ProductsKeyword1657078352245717564529964061433605937547982Campaign ABCAd GroupPortfolio DEFenabledenabledenabled0.500.30Keywordsbroad000.00%0.000.00000.000.00%0.000.00
28Sponsored ProductsCampaign258754573589174Campaign ABCCampaign ABC20220101AUTOenabledenabled1.00Fixed bid000.00%0.000.00000.000.00%0.000.00
29Sponsored ProductsBidding Adjustment258754573589174Campaign ABCenabledFixed bidplacementProductPage0.00000.00%0.000.00000.000.00%0.000.00
30Sponsored ProductsBidding Adjustment258754573589174Campaign ABCenabledFixed bidplacementTop0.00000.00%0.000.00000.000.00%0.000.00
31Sponsored ProductsAd Group258754573589174153129680764393Ad GroupCampaign ABCAd Groupenabledenabledenabled0.50000.00%0.000.00000.000.00%0.000.00
32Sponsored ProductsProduct Ad258754573589174153129680764393205260612829258Campaign ABCAd Groupenabledenabledenabled000.00%0.000.00000.000.00%0.000.00
33Sponsored ProductsProduct Targeting258754573589174153129680764393275458494159742Campaign ABCAd Grouppausedenabledenabled0.500.50close-matchclose-match000.00%0.000.00000.000.00%0.000.00
34Sponsored ProductsProduct Targeting258754573589174153129680764393146968282550236Campaign ABCAd Grouppausedenabledenabled0.500.50loose-matchloose-match000.00%0.000.00000.000.00%0.000.00
35Sponsored ProductsProduct Targeting258754573589174153129680764393224116759652864Campaign ABCAd Groupenabledenabledenabled0.500.50complementscomplements000.00%0.000.00000.000.00%0.000.00
36Sponsored ProductsProduct Targeting258754573589174153129680764393217549954321005Campaign ABCAd Grouppausedenabledenabled0.500.50substitutessubstitutes000.00%0.000.00000.000.00%0.000.00
37Sponsored ProductsCampaign80528116931698Campaign ABCCampaign ABC20220101MANUALenabledenabled1.00Fixed bid000.00%0.000.00000.000.00%0.000.00
38Sponsored ProductsBidding Adjustment80528116931698Campaign ABCenabledFixed bidplacementTop0.00000.00%0.000.00000.000.00%0.000.00
39Sponsored ProductsBidding Adjustment80528116931698Campaign ABCenabledFixed bidplacementProductPage0.00000.00%0.000.00000.000.00%0.000.00
40Sponsored ProductsAd Group8052811693169876107481712643Ad GroupCampaign ABCAd Groupenabledenabledenabled1.10000.00%0.000.00000.000.00%0.000.00
41Sponsored ProductsProduct Ad8052811693169876107481712643147693024949029Campaign ABCAd Groupenabledenabledenabled000.00%0.000.00000.000.00%0.000.00
42Sponsored ProductsKeyword80528116931698761074817126438859256792213Campaign ABCAd Groupenabledenabledenabled1.100.63Keywordsexact000.00%0.000.00000.000.00%0.000.00
43Sponsored ProductsKeyword8052811693169876107481712643247684218438325Campaign DEFAd Groupenabledenabledenabled1.100.63Keywordsexact000.00%0.000.00000.000.00%0.000.00
44Sponsored ProductsKeyword8052811693169876107481712643158916859273288Campaign DEFAd Groupenabledenabledenabled1.100.66Keywordsexact000.00%0.000.00000.000.00%0.000.00
45Sponsored ProductsKeyword8052811693169876107481712643118360102721703Campaign DEFAd Groupenabledenabledenabled1.100.66Keywordsexact000.00%0.000.00000.000.00%0.000.00
46Sponsored ProductsKeyword8052811693169876107481712643260134484145018Campaign DEFAd Groupenabledenabledenabled1.100.63Keywordsexact000.00%0.000.00000.000.00%0.000.00
47Sponsored ProductsKeyword805281169316987610748171264330584086520380Campaign DEFAd Groupenabledenabledenabled1.101.07Keywordsexact000.00%0.000.00000.000.00%0.000.00
48Sponsored ProductsKeyword8052811693169876107481712643263694419951020Campaign DEFAd Groupenabledenabledenabled1.100.46Keywordsexact000.00%0.000.00000.000.00%0.000.00
49Sponsored ProductsKeyword8052811693169876107481712643150620715834560Campaign DEFAd Groupenabledenabledenabled1.100.63Keywordsexact000.00%0.000.00000.000.00%0.000.00
50Sponsored ProductsKeyword8052811693169876107481712643239054561561844Campaign DEFAd Groupenabledenabledenabled1.100.79Keywordsexact000.00%0.000.00000.000.00%0.000.00
51Sponsored ProductsKeyword8052811693169876107481712643183475837427392Campaign DEFAd Groupenabledenabledenabled1.100.79Keywordsexact000.00%0.000.00000.000.00%0.000.00
BOOK1


Control Panel

Bulk File 07.06.22.xlsx
ABCDEFGH
1EntityCampaign Name (phrase match)ImpressionsClicks Spend SalesOrdersUnits
2KeywordABC
3Product TargetingDEF
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Control Panel
 

Attachments

  • Final Result.png
    Final Result.png
    36.4 KB · Views: 9

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
With XL2BB, hide irrelevant columns to keep the mini-sheet smaller.
I have added some values in 'BOOK1'
Also, check that your headings match - there is a trailing space on a couple of them in your sample data. That would make the formula fail.

An Quala.xlsm
BLAHAIAJAKALAMAN
1EntityCampaign NameImpressionsClicksClick-through RateSpendSalesOrdersUnits
2CampaignCampaign ABC4714358
3Bidding AdjustmentCampaign ABC4494447
4Bidding AdjustmentCampaign ABC4697712
5Ad GroupCampaign ABC7389879
6Product AdCampaign ABC4285163
7Product TargetingCampaign ABC6166352
8Product TargetingCampaign ABC8313447
9Product TargetingCampaign ABC1762953
10Product TargetingCampaign ABC1519581
11CampaignCampaign ABC4259758
12Bidding AdjustmentCampaign ABC4683591
13Bidding AdjustmentCampaign ABC5989113
14Ad GroupCampaign ABC3936182
15Product AdCampaign ABC7333841
16KeywordCampaign ABC3737218
17Negative KeywordCampaign ABC6581926
18Negative KeywordCampaign ABC8576614
19Negative KeywordCampaign ABC3469212
20Negative KeywordCampaign ABC8826447
21Negative KeywordCampaign ABC5544525
22CampaignCampaign ABC7311792
23Bidding AdjustmentCampaign ABC6821533
24Bidding AdjustmentCampaign ABC3331414
25Ad GroupCampaign ABC2392759
26Product AdCampaign ABC3289896
27KeywordCampaign ABC8417254
28CampaignCampaign ABC1895773
29Bidding AdjustmentCampaign ABC3185666
30Bidding AdjustmentCampaign ABC2357392
31Ad GroupCampaign ABC9769113
32Product AdCampaign ABC8465485
33Product TargetingCampaign ABC9917983
34Product TargetingCampaign ABC9589463
35Product TargetingCampaign ABC3767991
36Product TargetingCampaign ABC7885799
37CampaignCampaign ABC1179332
38Bidding AdjustmentCampaign ABC6692793
39Bidding AdjustmentCampaign ABC6588528
40Ad GroupCampaign ABC4349431
41Product AdCampaign ABC6191643
42KeywordCampaign ABC4578425
43KeywordCampaign DEF1179553
44KeywordCampaign DEF7797586
45KeywordCampaign DEF4756836
46KeywordCampaign DEF6146735
47KeywordCampaign DEF1837216
48KeywordCampaign DEF1773964
49KeywordCampaign DEF8377416
50KeywordCampaign DEF9163466
51KeywordCampaign DEF4651329
BOOK1



An Quala.xlsm
ABCDEFGH
1EntityCampaign NameImpressionsClicksSpendSalesOrdersUnits
2KeywordABC1516228817
3Product TargetingDEF000000
Control Panel
Cell Formulas
RangeFormula
C2:H3C2=SUM(FILTER(INDEX(BOOK1!$AH$2:$AN$51,0,MATCH(C$1,BOOK1!$AH$1:$AN$1,0)),((BOOK1!$B$2:$B$51=$A2)*ISNUMBER(SEARCH(" "&$B2&" "," "&BOOK1!$L$2:$L$51&" "))),0))
 
Upvote 0
Solution
Hello @Peter_SSs Sorry I had to add a few more details in the last query because last time it was difficult to focus on tiny details, I also made a separate post about this but admins asked me to continue this thread, so it would be great if you add up the following details into the last requirements, thanks!

So I need to add these details,

1- Before summing up it should also check in Sheet "BOOK1" Column R,S,T to be "enabled", if not, ignore the values.

2- Add one more column (No of campaigns) in Control Panel which Sum up the no of correspondences of that keyword in Column "Campaign Name (Information Only" (L) for example "ABC" occurs just 1 time in the sample data (screenshot attached) and columns R and S = "enabled" and Column B = "Campaign", so for EXAMPLE: for row 3, it will look something like this, B3 = Campaign, R3 = enabled, S3 = enabled, L3 contained "ABC", then 1 occurrence and so on.

3- The number of rows in the data is not fixed, in this case it is 61, but it should be unlimited.

Thank you.

BOOK1

Book3.xlsx
BLRSTAHAIAJAKALAMAN
1EntityCampaign Name (Informational only)StateCampaign State (Informational only)Ad Group State (Informational only)ImpressionsClicksClick-through RateSpendSalesOrdersUnits
2KeywordCampaign ABCenabledenabledenabled1001010502.00%10.00100.0056
3CampaignCampaign ABCenabledenabled1001010602.00%10.00100.0056
4Bidding AdjustmentCampaign ABCenabled1001010702.00%10.00100.0056
5Bidding AdjustmentCampaign ABCenabled1001010802.00%10.00100.0056
6Ad GroupCampaign ABCenabledenabledenabled1001010902.00%10.00100.0056
7Product AdCampaign ABCenabledenabledenabled1001011002.00%10.00100.0056
8KeywordCampaign ABCenabledenabledenabled1001011102.00%10.00100.0056
9KeywordCampaign ABCenabledenabledenabled1001011202.00%10.00100.0056
10KeywordCampaign ABCenabledenabledenabled1001011302.00%10.00100.0056
11KeywordCampaign ABCenabledenabledenabled1001011402.00%10.00100.0056
12Product TargetingCampaign ABCenabledenabledenabled1001011502.00%10.00100.0056
13CampaignCampaign ABCpausedpaused1001011602.00%10.00100.0056
14Bidding AdjustmentCampaign ABCpaused1001011702.00%10.00100.0056
15Bidding AdjustmentCampaign ABCpaused1001011802.00%10.00100.0056
16Ad GroupCampaign ABCenabledpausedenabled1001011902.00%10.00100.0056
17Product AdCampaign ABCenabledpausedenabled1001012002.00%10.00100.0056
18KeywordCampaign ABCenabledpausedenabled1001012102.00%10.00100.0056
19KeywordCampaign ABCpausedpausedenabled1001012202.00%10.00100.0056
20KeywordCampaign ABCpausedpausedenabled1001012302.00%10.00100.0056
21KeywordCampaign ABCpausedpausedenabled1001012402.00%10.00100.0056
22KeywordCampaign DEFpausedpausedenabled1001012502.00%10.00100.0056
23KeywordCampaign DEFenabledpausedenabled1001012602.00%10.00100.0056
24KeywordCampaign DEFenabledpausedenabled1001012702.00%10.00100.0056
25KeywordCampaign DEFenabledpausedenabled1001012802.00%10.00100.0056
26KeywordCampaign DEFenabledpausedenabled1001012902.00%10.00100.0056
27KeywordCampaign DEFenabledpausedenabled1001013002.00%10.00100.0056
28KeywordCampaign DEFenabledpausedenabled1001013102.00%10.00100.0056
29KeywordCampaign DEFenabledpausedenabled1001013202.00%10.00100.0056
30KeywordCampaign DEFenabledpausedenabled1001013302.00%10.00100.0056
31KeywordCampaign DEFenabledpausedenabled1001013402.00%10.00100.0056
32KeywordCampaign DEFenabledpausedenabled1001013502.00%10.00100.0056
33KeywordCampaign DEFenabledpausedenabled1001013602.00%10.00100.0056
34KeywordCampaign DEFenabledpausedenabled1001013702.00%10.00100.0056
35KeywordCampaign DEFenabledpausedenabled1001013802.00%10.00100.0056
36KeywordCampaign DEFenabledpausedenabled1001013902.00%10.00100.0056
37KeywordCampaign DEFenabledpausedenabled1001014002.00%10.00100.0056
38KeywordCampaign DEFenabledpausedenabled1001014102.00%10.00100.0056
39KeywordCampaign DEFenabledpausedenabled1001014202.00%10.00100.0056
40KeywordCampaign DEFenabledpausedenabled1001014302.00%10.00100.0056
41KeywordCampaign DEFenabledpausedenabled1001014402.00%10.00100.0056
42KeywordCampaign DEFenabledpausedenabled1001014502.00%10.00100.0056
43KeywordCampaign DEFenabledpausedenabled1001014602.00%10.00100.0056
44KeywordCampaign DEFenabledpausedenabled1001014702.00%10.00100.0056
45KeywordCampaign DEFenabledpausedenabled1001014802.00%10.00100.0056
46KeywordCampaign DEFenabledpausedenabled1001014902.00%10.00100.0056
47KeywordCampaign DEFenabledpausedenabled1001015002.00%10.00100.0056
48KeywordCampaign DEFenabledpausedenabled1001015102.00%10.00100.0056
49KeywordCampaign DEFenabledpausedenabled1001015202.00%10.00100.0056
50KeywordCampaign DEFenabledpausedenabled1001015302.00%10.00100.0056
51KeywordCampaign DEFenabledpausedenabled1001015402.00%10.00100.0056
52KeywordCampaign GHIenabledpausedenabled1001015502.00%10.00100.0056
53KeywordCampaign GHIenabledpausedenabled1001015602.00%10.00100.0056
54KeywordCampaign GHIenabledpausedenabled1001015702.00%10.00100.0056
55KeywordCampaign GHIenabledpausedenabled1001015802.00%10.00100.0056
56KeywordCampaign GHIenabledpausedenabled1001015902.00%10.00100.0056
57KeywordCampaign GHIenabledpausedenabled1001016002.00%10.00100.0056
58KeywordCampaign GHIenabledpausedenabled1001016102.00%10.00100.0056
59KeywordCampaign GHIenabledpausedenabled1001016202.00%10.00100.0056
60KeywordCampaign GHIenabledpausedenabled1001016302.00%10.00100.0056
61KeywordCampaign GHIenabledpausedenabled1001016402.00%10.00100.0056
BOOK1


Control Panel

Book3.xlsx
ABCDEFGHIJ
1EntityCampaign Name (Informational only)ImpressionsClicksClick-through RateSpendSalesOrdersUnitsNumber of Campaigns
2KeywordABC900901045.18909004554
3KeywordDEF30003004185.63003000150180
4KeywordGHI10001001595.210010005060
5Product TargetingABC10010115.021010056
Control Panel
Cell Formulas
RangeFormula
C2:I5C2=SUM(FILTER(INDEX(BOOK1!$AH$2:$AN$61,0,MATCH(C$1,BOOK1!$AH$1:$AN$1,0)),((BOOK1!$B$2:$B$61=$A2)*ISNUMBER(SEARCH(" "&$B2&" "," "&BOOK1!$L$2:$L$61&" "))),0))
 

Attachments

  • Occurence Example in sample data.png
    Occurence Example in sample data.png
    15.5 KB · Views: 6
Upvote 0
Hello for point no 1, all 3 Columns R,S and T should be "enabled", if either one of them is not, then ignore the value.

For point no 2, only 2 Columns, R and S should be "enabled" just like first one.

Thank you.
 
Upvote 0
1- Before summing up it should also check in Sheet "BOOK1" Column R,S,T to be "enabled", if not, ignore the values.
Is this what you mean?

An Quala_1.xlsm
ABCDEFGHI
1EntityCampaign Name (Informational only)ImpressionsClicksClick-through RateSpendSalesOrdersUnits
2KeywordABC50050555.1505002530
3KeywordDEF0000000
4KeywordGHI0000000
5Product TargetingABC10010115.021010056
Control Panel
Cell Formulas
RangeFormula
C2:I5C2=SUM(FILTER(INDEX(BOOK1!$AH$2:$AN$61,0,MATCH(C$1,BOOK1!$AH$1:$AN$1,0)),((BOOK1!$B$2:$B$61=$A2)*ISNUMBER(SEARCH(" "&$B2&" "," "&BOOK1!$L$2:$L$61&" "))*(BOOK1!$R$2:$R$61&BOOK1!$S$2:$S$61&BOOK1!$T$2:$T$61="EnabledEnabledEnabled")),0))



2- Add one more column (No of campaigns) in Control Panel which Sum up the no of correspondences of that keyword in Column "Campaign Name (Information Only" (L) for example "ABC" occurs just 1 time in the sample data (screenshot attached) and columns R and S = "enabled" and Column B = "Campaign", so for EXAMPLE: for row 3, it will look something like this, B3 = Campaign, R3 = enabled, S3 = enabled, L3 contained "ABC", then 1 occurrence and so on.
I'm still not entirely sure what is required here. For the 'Control Panel' shown in post #4, what would be the actual expected results in each of J2:J5 for the sample data provided in that post?


3- The number of rows in the data is not fixed, in this case it is 61, but it should be unlimited.
Just choose a number big enough to cover any expected data size, but I would highly recommend not using whole column references as they may bog your sheet's performance right down.
So if your data might be, say a maximum of a few hundred rows, then change the 61 to, say, 1000.
 
Upvote 0
Is this what you mean?
1- Yeah it's correct, we also have another option, as entity would always be either "Keyword" or "Product Targeting", can we embed these values in the formula instead of typing them into the cells? As campaign name would be unique for both so they won't get mixed.

I'm still not entirely sure what is required here. For the 'Control Panel' shown in post #4, what would be the actual expected results in each of J2:J5 for the sample data provided in that post?
2- Simply put, how many times does the campaign name is occurring containing this keyword with enabled status in R and S, but in "Campaign" Entity not keyword or product targeting entity, I have attached the sample data with resulted values (changed data a little bit than last time to make it better). You can also refer to the attached picture to understand how to apply filters in the data, it would be understandable.
Here is the formula for campaign occurence of "ABC",
=IF(AND($B2="Campaign",ISNUMBER(SEARCH("ABC",$L2)),$R2="enabled",$S2="enabled"),1,0) will give you 2 occurences in the data.

Just choose a number big enough to cover any expected data size, but I would highly recommend not using whole column references as they may bog your sheet's performance right down.
3- Sure.

Book3.xlsx
BLRSTAHAIAJAKALAMAN
1EntityCampaign Name (Informational only)StateCampaign State (Informational only)Ad Group State (Informational only)ImpressionsClicksClick-through RateSpendSalesOrdersUnits
2KeywordCampaign ABCenabledenabledenabled1001010502.00%10.00100.0056
3CampaignCampaign ABCenabledenabled1001010602.00%10.00100.0056
4Bidding AdjustmentCampaign ABCenabledenabled1001010702.00%10.00100.0056
5Bidding AdjustmentCampaign ABCenabledenabled1001010802.00%10.00100.0056
6Ad GroupCampaign ABCenabledenabledenabled1001010902.00%10.00100.0056
7Product AdCampaign ABCenabledenabledenabled1001011002.00%10.00100.0056
8KeywordCampaign ABCenabledenabledenabled1001011102.00%10.00100.0056
9KeywordCampaign ABCenabledenabledenabled1001011202.00%10.00100.0056
10KeywordCampaign ABCenabledenabledenabled1001011302.00%10.00100.0056
11KeywordCampaign ABCenabledenabledenabled1001011402.00%10.00100.0056
12Product TargetingCampaign ABCenabledenabledenabled1001011502.00%10.00100.0056
13CampaignCampaign ABCenabledenabled1001011602.00%10.00100.0056
14Bidding AdjustmentCampaign ABCenabledenabled1001011702.00%10.00100.0056
15Bidding AdjustmentCampaign ABCenabledenabled1001011802.00%10.00100.0056
16Ad GroupCampaign ABCenabledenabledenabled1001011902.00%10.00100.0056
17Product AdCampaign ABCenabledenabledenabled1001012002.00%10.00100.0056
18KeywordCampaign ABCenabledenabledenabled1001012102.00%10.00100.0056
19KeywordCampaign ABCenabledenabledenabled1001012202.00%10.00100.0056
20KeywordCampaign ABCenabledenabledenabled1001012302.00%10.00100.0056
21KeywordCampaign ABCenabledenabledenabled1001012402.00%10.00100.0056
22CampaignCampaign DEFenabledenabled1001012502.00%10.00100.0056
23KeywordCampaign DEFenabledenabledenabled1001012602.00%10.00100.0056
24KeywordCampaign DEFenabledenabledenabled1001012702.00%10.00100.0056
25KeywordCampaign DEFenabledenabledenabled1001012802.00%10.00100.0056
26KeywordCampaign DEFenabledenabledenabled1001012902.00%10.00100.0056
27KeywordCampaign DEFenabledenabledenabled1001013002.00%10.00100.0056
28KeywordCampaign DEFenabledenabledenabled1001013102.00%10.00100.0056
29KeywordCampaign DEFenabledenabledenabled1001013202.00%10.00100.0056
30KeywordCampaign DEFenabledenabledenabled1001013302.00%10.00100.0056
31KeywordCampaign DEFenabledenabledenabled1001013402.00%10.00100.0056
32KeywordCampaign DEFenabledenabledenabled1001013502.00%10.00100.0056
33KeywordCampaign DEFenabledenabledenabled1001013602.00%10.00100.0056
34KeywordCampaign DEFenabledenabledenabled1001013702.00%10.00100.0056
35KeywordCampaign DEFenabledenabledenabled1001013802.00%10.00100.0056
36CampaignCampaign DEFenabledpaused1001013902.00%10.00100.0056
37KeywordCampaign DEFenabledenabledenabled1001014002.00%10.00100.0056
38KeywordCampaign DEFenabledenabledenabled1001014102.00%10.00100.0056
39KeywordCampaign DEFenabledenabledenabled1001014202.00%10.00100.0056
40KeywordCampaign DEFenabledenabledenabled1001014302.00%10.00100.0056
41KeywordCampaign DEFenabledenabledenabled1001014402.00%10.00100.0056
42KeywordCampaign DEFenabledenabledenabled1001014502.00%10.00100.0056
43KeywordCampaign DEFenabledenabledenabled1001014602.00%10.00100.0056
44KeywordCampaign DEFenabledenabledenabled1001014702.00%10.00100.0056
45KeywordCampaign DEFenabledenabledenabled1001014802.00%10.00100.0056
46KeywordCampaign DEFenabledenabledenabled1001014902.00%10.00100.0056
47KeywordCampaign DEFenabledenabledenabled1001015002.00%10.00100.0056
48KeywordCampaign DEFenabledenabledenabled1001015102.00%10.00100.0056
49CampaignCampaign DEFpausedenabled1001015202.00%10.00100.0056
50KeywordCampaign DEFenabledenabledenabled1001015302.00%10.00100.0056
51KeywordCampaign DEFenabledenabledenabled1001015402.00%10.00100.0056
52KeywordCampaign GHIenabledenabledenabled1001015502.00%10.00100.0056
53KeywordCampaign GHIenabledenabledenabled1001015602.00%10.00100.0056
54KeywordCampaign GHIenabledenabledenabled1001015702.00%10.00100.0056
55KeywordCampaign GHIenabledenabledenabled1001015802.00%10.00100.0056
56KeywordCampaign GHIenabledenabledenabled1001015902.00%10.00100.0056
57KeywordCampaign GHIenabledenabledenabled1001016002.00%10.00100.0056
58CampaignCampaign GHIenabledenabled1001016102.00%10.00100.0056
59KeywordCampaign GHIenabledenabledenabled1001016202.00%10.00100.0056
60KeywordCampaign GHIenabledenabledenabled1001016302.00%10.00100.0056
61KeywordCampaign GHIenabledenabledenabled1001016402.00%10.00100.0056
BOOK1


Book3.xlsx
ABCDEFGHIJ
1EntityCampaign Name (Informational only)ImpressionsClicksClick-through RateSpendSalesOrdersUnitsNo of campaigns
2KeywordABC900901045.189090045542
3KeywordDEF27002703769.5427027001351621
4KeywordGHI900901434.189090045541
5Product TargetingABCD00000000
Control Panel
Cell Formulas
RangeFormula
C2:I5C2=SUM(FILTER(INDEX(BOOK1!$AH$2:$AN$61,0,MATCH(C$1,BOOK1!$AH$1:$AN$1,0)),((BOOK1!$B$2:$B$61=$A2)*ISNUMBER(SEARCH(" "&$B2&" "," "&BOOK1!$L$2:$L$61&" "))*(BOOK1!$R$2:$R$61&BOOK1!$S$2:$S$61&BOOK1!$T$2:$T$61="EnabledEnabledEnabled")),0))
 

Attachments

  • How to apply filters to get campaign occurences.png
    How to apply filters to get campaign occurences.png
    32.9 KB · Views: 6
Last edited:
Upvote 0
Sure, please forget about the point 1, can you add point 2 only please?
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

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