Forestq

Active Member
Joined
May 9, 2010
Messages
482
hi,

I have 4 selected criteria (data validation list):
column A1 = Region
column C1 = Country
column E1 = Owner
column G1 = Service.

In my data rows region is in column AN, country in column AJ, owner in column AM and service in column AR.

AN - RegionAJ - CountryAM - OwnerAR -ServiceAA - COSTAB - COST TYPE
EUNLNicolaAFT200F
EUESPTomAT150F
AFCONSimomAFT180P
AZJPChiAFTX230F

<tbody>
</tbody>
example:
user can select only region = EU, region = EU and country = ESP, country = NL and Owner = Nicola etc....for me it`s 14 diffrent cases.

Always I want to get sum (COST, column AA) where COST TYPE= F.

How can I do that?
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
I have this problem with using OR function in Excel.

Here is the data structure

all data starts from row 7

Column A - is date

Column C - is batch ( contains batches like, payroll, payroll check, etc.)

Column H- is the amount I want to add

the criteria date is on A4,

here is formula in error
Sheets("Out").Range("D4").value = _
"=SUMIFS(H7:H125,A7:A125,A4,C7:C125,""*Payroll*"" OR C7:C125,""*Paycheck*"")"

the criteria is on A4. So basically, I want to add all data on H, with a date criteria = to A4, containing a batch code of "Payroll" OR "Paycheck" the batch code is on column C.

Thanks.
 
Upvote 0
Hi and welcome to Mr Excel forum

Try this

Code:
Sheets("Out").Range("D4").Value = _
"=SUM(SUMIFS(H7:H125,A7:A125,A4,C7:C125,{""*Payroll*"",""*Paycheck*""}))"

Hope this helps

M.
 
Upvote 0
Hi and welcome to Mr Excel forum

Try this

Code:
Sheets("Out").Range("D4").Value = _
"=SUM(SUMIFS(H7:H125,A7:A125,A4,C7:C125,{""*Payroll*"",""*Paycheck*""}))"

Hope this helps

M.


Hey M,

It works I did not know that I need to put the sum. Thanks for the quick reply too. I have been trying to crack my brain for a day now for this. Once again. Thanks.
 
Upvote 0
Hey M,

It works I did not know that I need to put the sum. Thanks for the quick reply too. I have been trying to crack my brain for a day now for this. Once again. Thanks.

You are welcome. Glad for helping.

M.
 
Upvote 0

Forum statistics

Threads
1,215,537
Messages
6,125,386
Members
449,221
Latest member
DFCarter

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