SOLVED

another match/search and return value challenge

%3CLINGO-SUB%20id%3D%22lingo-sub-1826850%22%20slang%3D%22en-US%22%3Eanother%20match%2Fsearch%20and%20return%20value%20challenge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1826850%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20new%20challenge.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20document%20is%20attached%20for%20ease%20of%20understanding.%26nbsp%3B%20Basically%2C%20I'm%20trying%20to%20retrieve%20data%20from%20the%20Search%20tab%20and%20return%20the%20value%20in%20the%20other%20tab.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20combination%20of%20functions%20can%20I%20use%3F%26nbsp%3B%20Thanks%20(again!).%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1826850%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1826915%22%20slang%3D%22en-US%22%3ERe%3A%20another%20match%2Fsearch%20and%20return%20value%20challenge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1826915%22%20slang%3D%22en-US%22%3E%3CP%3EWith%20the%20attachment.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1827004%22%20slang%3D%22en-US%22%3ERe%3A%20another%20match%2Fsearch%20and%20return%20value%20challenge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1827004%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F835216%22%20target%3D%22_blank%22%3E%40Maddy1010%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20C48%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DSUMIF(Search!%24A%242%3A%24A%2437%2C%24A48%2CINDEX(Search!%24B%242%3A%24Q%2437%2C0%2CMATCH(C%242%2CSearch!%24B%241%3A%24Q%241%2C0)))%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EFill%20to%20the%20right%20to%20column%20F%2C%20then%20down%20to%20row%2050%20(or%20vice%20versa).%3C%2FP%3E%0A%3CP%3EIn%20H48%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DSUM(C48%3AF48)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EFill%20down%20to%20row%2050.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1828083%22%20slang%3D%22en-US%22%3ERe%3A%20another%20match%2Fsearch%20and%20return%20value%20challenge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1828083%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3BThanks%20for%20this!%26nbsp%3B%20It%20worked%20again.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3EJust%20to%20add%20complexity%20--%20I%20would%20like%20to%20add%20a%20'check'%26nbsp%3B%20by%20adding%20a%20Total%20(Row%2052)%20vs%20%3Dsum%20function.%26nbsp%3B%20Filtering%20the%20data%2C%20I%20can%20trust%20Row%2052%20--%20but%20now%2C%20the%2053%2C%2054%20and%2055%20are%20not%20following.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1829521%22%20slang%3D%22en-US%22%3ERe%3A%20another%20match%2Fsearch%20and%20return%20value%20challenge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1829521%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F835216%22%20target%3D%22_blank%22%3E%40Maddy1010%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI'm%20afraid%20I%20don't%20understand%20what%20you%20are%20trying%20to%20do%20now.%20Can%20you%20explain%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1829586%22%20slang%3D%22en-US%22%3ERe%3A%20another%20match%2Fsearch%20and%20return%20value%20challenge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1829586%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3B%20Hi%20Hans%2C%20sorry%20I%20wasn't%20clear%20at%20all.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBasically%2C%20rows%2053%20and%2054%20in%20total%20should%20equal%20row%2052%2C%20with%20a%20formula%20that%20would%20match%20column%20A%20and%20column%20C%2C%20row%201%2C%20row%206%2C%20etc.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESomething%20like%2C%20if%20'CC_ABCD%20-%20Apples'%20%26amp%3B%20'All%20other%20OPEX'%20%26amp%3B%20'2018.Q1'%20matches%20data%20in%20Search%20tab%20in%20Column%20S%2C%20then%20return%20value.%26nbsp%3B%20Sorry%2C%20I'm%20not%20good%20at%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Maddy1010_0-1603915846994.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F229919i305740CCF3B4C5F1%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Maddy1010_0-1603915846994.png%22%20alt%3D%22Maddy1010_0-1603915846994.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1829675%22%20slang%3D%22en-US%22%3ERe%3A%20another%20match%2Fsearch%20and%20return%20value%20challenge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1829675%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F835216%22%20target%3D%22_blank%22%3E%40Maddy1010%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThere%20is%20no%20reason%20rows%2053%20and%2054%20should%20add%20up%20to%20row%2052.%3C%2FP%3E%0A%3CP%3EThe%20formulas%20in%20row%2053%20and%2054%20sum%20all%20values%20on%20the%20Search%20sheet%20for%20Apples%20and%20Bananas%2C%20but%20those%20rows%20have%20both%20IHQInternational%20ManagementHR%20%2F%20Staff%20Costs%20and%20IHQFruitsAll%20other%20OPEX%20in%20column%20R.%3C%2FP%3E%0A%3CP%3EThe%20formulas%20in%20row%2052%20sum%20the%20values%20for%20IHQFruitsAll%20other%20OPEX%20only%2C%20not%20those%20for%20IHQInternational%20ManagementHR%20%2F%20Staff%20Costs%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1829696%22%20slang%3D%22en-US%22%3ERe%3A%20another%20match%2Fsearch%20and%20return%20value%20challenge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1829696%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%2C%20rows%2053%2C%2054%20(and%2055%20if%20with%20values)%2C%20should%20add%20up%20to%20row%2052%2C%20in%20case%20Column%20R%20in%20Search%20tab%20says%26nbsp%3B%3CSPAN%3EIHQFruitsAll%20other%20OPEX.%26nbsp%3B%20So%20the%20qualifier%20will%20be%26nbsp%3BIHQFruitsAll%20other%20OPEX.%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EIf%20I%20filer%20Column%20R%20in%20Search%20tab%2C%20the%20totals%20in%20Column%20E%20in%20Search%20tab%20would%20be%20547.9%20(divided%20between%26nbsp%3BCC_43598%20-%20Bananas%20and%26nbsp%3BCC_ABCD%20-%20Apples.)%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I have a new challenge.  

 

The document is attached for ease of understanding.  Basically, I'm trying to retrieve data from the Search tab and return the value in the other tab.

 

What combination of functions can I use?  Thanks (again!).

@Hans Vogelaar 

16 Replies

With the attachment.

@Maddy1010 

In C48:

=SUMIF(Search!$A$2:$A$37,$A48,INDEX(Search!$B$2:$Q$37,0,MATCH(C$2,Search!$B$1:$Q$1,0)))

Fill to the right to column F, then down to row 50 (or vice versa).

In H48:

=SUM(C48:F48)

Fill down to row 50.

@Hans Vogelaar Thanks for this!  It worked again.  

Just to add complexity -- I would like to add a 'check'  by adding a Total (Row 52) vs =sum function.  Filtering the data, I can trust Row 52 -- but now, the 53, 54 and 55 are not following.  

@Maddy1010 

I'm afraid I don't understand what you are trying to do now. Can you explain?

@Hans Vogelaar  Hi Hans, sorry I wasn't clear at all.  

 

Basically, rows 53 and 54 in total should equal row 52, with a formula that would match column A and column C, row 1, row 6, etc.  

 

Something like, if 'CC_ABCD - Apples' & 'All other OPEX' & '2018.Q1' matches data in Search tab in Column S, then return value.  Sorry, I'm not good at this.

 

 

Maddy1010_0-1603915846994.png

 

@Maddy1010 

There is no reason rows 53 and 54 should add up to row 52.

The formulas in row 53 and 54 sum all values on the Search sheet for Apples and Bananas, but those rows have both IHQInternational ManagementHR / Staff Costs and IHQFruitsAll other OPEX in column R.

The formulas in row 52 sum the values for IHQFruitsAll other OPEX only, not those for IHQInternational ManagementHR / Staff Costs

@Hans Vogelaar 

 

So, rows 53, 54 (and 55 if with values), should add up to row 52, in case Column R in Search tab says IHQFruitsAll other OPEX.  So the qualifier will be IHQFruitsAll other OPEX.  

 

If I filer Column R in Search tab, the totals in Column E in Search tab would be 547.9 (divided between CC_43598 - Bananas and CC_ABCD - Apples.)

@Hans Vogelaar I promise, I'm doing my best to express my thoughts :-).

 

If A53 in Return Value matches Column A in Search, C1 in Return Value matches Column R in Search, C6 in Return Value matches Row 2 in Search, then return value in Search tab range B4: Q38

@Maddy1010 

In C53:

=SUMIFS(INDEX(Search!$B$3:$Q$38,0,MATCH(C$6,Search!$B$2:$Q$2,0)),Search!$A$3:$A$38,$A53,Search!$R$3:$R$38,$A$5&$A$52&C$1)/1000

 

Fill to the right and down.

@Hans Vogelaar This is pure witchcraft.  You solved that in seconds.  

@Hans Vogelaar 

 

I am attempting to fill cells C10:M12.  Qualifiers are:  Rows 1,2,3 and Column A -- all in Sheet3.  Sheet4 has all the data.  

 

I tried a combination of the formulas you gave me so far, but it doesnt seem applicable on this one since I added a new 'qualifier'  which is Row 2.

@Maddy1010 

In C10:

=SUMIFS(INDEX(Sheet4!$B$13:$K$46,0,MATCH(C$2&C$3,Sheet4!$A$10:$K$10,0)),Sheet4!$A$13:$A$46,$A10,Sheet4!$L$13:$L$46,$A$8&$A$9&C$1)/1000

@Hans Vogelaar 

 

This time, I literally copy/pasted the formula onto my test sheet but the answer is not coming up correctly.

 

Maddy1010_0-1603998469363.png

I was expecting Row 10,11,12 to add up to Row 9.  What am I doing wrong?

@Hans Vogelaar 

 

It would seem, that somehow, the values are picking up the next column other than intended:  I really don't understand how come.

Best Response confirmed by Maddy1010 (Occasional Contributor)
Solution

@Maddy1010 

Sorry, my mistake. It should have been

=SUMIFS(INDEX(Sheet4!$B$13:$K$46,0,MATCH(C$2&C$3,Sheet4!$B$10:$K$10,0)),Sheet4!$A$13:$A$46,$A10,Sheet4!$L$13:$L$46,$A$8&$A$9&C$1)/1000

@Hans VogelaarIt worked!!!!  Thank you!!!