ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Add up a Dynamic Range with 2 Variables (https://www.excelbanter.com/excel-worksheet-functions/9281-add-up-dynamic-range-2-variables.html)

John

Add up a Dynamic Range with 2 Variables
 
I am trying to add up a Dynamic column if 2 variables are valid. I've tried
the folowing formula with only 1 variable and it works great

=(SUMIF(StaffType,"="&K13,Basic))

K13=Hourly and "Basic" is a range name set for total minutes worked

However what I want to do is add up Basic for only Hourly staff AND a
specific day. I have this day variable in AH9 and the Dates are in a Range
name called "DailyDate". I've tried the following but
there is an "too few arguements" error in the formula which I can't work
out. Is it possible?

=(SUMIF(AND(StaffType,"="&K13,DailyDate,"="&AH9,Ba sic))))


Thanks






Bob Phillips

=SUMPRODUCT(--(StaffType=K13),--(DailyDate=AH9),Basic)

all ranges must be the same size

--

HTH

RP
(remove nothere from the email address if mailing direct)


"John" wrote in message
...
I am trying to add up a Dynamic column if 2 variables are valid. I've

tried
the folowing formula with only 1 variable and it works great

=(SUMIF(StaffType,"="&K13,Basic))

K13=Hourly and "Basic" is a range name set for total minutes worked

However what I want to do is add up Basic for only Hourly staff AND a
specific day. I have this day variable in AH9 and the Dates are in a Range
name called "DailyDate". I've tried the following but
there is an "too few arguements" error in the formula which I can't work
out. Is it possible?

=(SUMIF(AND(StaffType,"="&K13,DailyDate,"="&AH9,Ba sic))))


Thanks









All times are GMT +1. The time now is 06:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com