Sumifs Match Formula.

srizki

Well-known Member
Joined
Jan 14, 2003
Messages
1,860
Office Version
  1. 365
Platform
  1. Windows
I need assistance creating a formula for column G in my Excel sheet. The formula should be able to match either column B or C, then search in another sheet named "PGL" for the cost center in column F or text in column E, and retrieve the value from column "CC".
If there are values in column C, the corresponding cell in column B is blank and vice versa.
Also, if there are more than one matches, I want the sum of the matching values.
Thank you very much.
 
Last edited:

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Match what to B or C?


search what?

Can you post a mockup example?
it is staraight forward, if the lookup value is in column B, use that lookup value and match that value with column F of sheet PGL. If there is nothing in column C there there must be text in column B, use that as a lookup value and match with values in column E of sheet PGL, and in both of these lookup values I need the sum of values from column CC in PGL,.
 
Upvote 0
it is staraight forward, if the lookup value is in column B, use that lookup value and match that value with column F of sheet PGL. If there is nothing in column C there there must be text in column B, use that as a lookup value and match with values in column E of sheet PGL, and in both of these lookup values I need the sum of values from column CC in PGL,.
It may be straight forward to you, but without a visual of your data with the expected results, and some vague-ish description provided, it is not clear or straight forward to us. You didn't say which lookup value (B or C) should match with columns F or E. So, if you would please, provide a sample of your data and the expected results.
 
Upvote 0
It may be straight forward to you, but without a visual of your data with the expected results, and some vague-ish description provided, it is not clear or straight forward to us. You didn't say which lookup value (B or C) should match with columns F or E. So, if you would please, provide a sample of your data and the expected results.If
It may be straight forward to you, but without a visual of your data with the expected results, and some vague-ish description provided, it is not clear or straight forward to us. You didn't say which lookup value (B or C) should match with columns F or E. So, if you would please, provide a sample of your data and the expected results.
It may be straight forward to you, but without a visual of your data with the expected results, and some vague-ish description provided, it is not clear or straight forward to us. You didn't say which lookup value (B or C) should match with columns F or E. So, if you would please, provide a sample of your data and the expected results.
If there is value in sheet 1, column C, then the matching value range on sheet 2 will be in column F, if that cell on sheet column C is blank,, then there must a value in column B, so we the lookup value is in column B that should match the range in sheet 2 column E. and the sum value is in column CC. 1
let me start over.
Sheet1, lookup values in columns B and C, if there are values in column B, the corresponding cell in column C is empty. vise versa, the range is on sheet 2, for column C in sheet1 the lookup up range is in column F on sheet2, and the lookup value on sheet1 column B corresponding range is in E sheet 2, in both of these ranges the Sum value could be S on Sheet2, lets say the sum range is in column CC of sheet2.
So basically the sume if formula will be =SUMIF(sheet2!FF,sheet1!C15,sheet2!CC), but I need two formulas one for lookup value in column C and another one for the lookup value in Column B. but the sum range is same for the both of these lookup up values. CC on sheet 2.
 
Upvote 0
in both of these ranges the Sum value could be S on Sheet2
Not sure how this applies, but it would still be incredibly helpful if you provided a sample of your data from both sheets and expected results. Some of us work better when we can see the problem.

But maybe this to start:
Book1
BCDE
2One2300
3Two2900
4Three1200
5Four1300
Sheet1
Cell Formulas
RangeFormula
E2:E5E2=SUMIF(Sheet2!$E$2:$E$17,B2,Sheet2!$CC$2:$CC$17)+SUMIF(Sheet2!$F$2:$F$17,C2,Sheet2!$CC$2:$CC$17)

Book1
EFCC
2One500
3Two1000
4Three300
5Four400
6One700
7Two800
8Three500
9Four300
10One200
11Two100
12Three300
13Four400
14One900
15Two1000
16Three100
17Four200
Sheet2
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,636
Members
452,662
Latest member
Aman1997

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