ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   if a:a (range) equals january and c:c equals gas then add g:g ($) (https://www.excelbanter.com/excel-worksheet-functions/62310-if-range-equals-january-c-c-equals-gas-then-add-g-g-%24.html)

BCOz

if a:a (range) equals january and c:c equals gas then add g:g ($)
 
a:a has is a range of monthly purchases and c:c is which month purchased. I
would like on a different sheet to calculate only those gas purchases in
january (automatically).
I tried this but did not succeed:

=IF(AND(Transactions!A:A=A:A,Transactions!C:C="gas oline"),SUM(Transactions!G:G),0)

Gary L Brown

if a:a (range) equals january and c:c equals gas then add g:g ($)
 
You want to sum on multiple criteria. You need an array formula.
Check out Chip Pearson's website. Specifically...
http://www.cpearson.com/excel/array.htm
He gives an example of exactly what you want.

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"BCOz" wrote:

a:a has is a range of monthly purchases and c:c is which month purchased. I
would like on a different sheet to calculate only those gas purchases in
january (automatically).
I tried this but did not succeed:

=IF(AND(Transactions!A:A=A:A,Transactions!C:C="gas oline"),SUM(Transactions!G:G),0)


BCOz

if a:a (range) equals january and c:c equals gas then add g:g ($)
 
I have already setup to calculate the total for the year, but I only want for
month by month. Is there not a way to say if a:a = jan and c:c = gas then
total column g:g and ignore all other months.

"BCOz" wrote:

a:a has is a range of monthly purchases and c:c is which month purchased. I
would like on a different sheet to calculate only those gas purchases in
january (automatically).
I tried this but did not succeed:

=IF(AND(Transactions!A:A=A:A,Transactions!C:C="gas oline"),SUM(Transactions!G:G),0)


Gary L Brown

if a:a (range) equals january and c:c equals gas then add g:g
 
Sorry, but if that excellent article by Chip hasn't explained it clearly to
you, I don't think I can do better. Please go back and re-read his article.
Sincerely,
Gary Brown


"BCOz" wrote:

I have already setup to calculate the total for the year, but I only want for
month by month. Is there not a way to say if a:a = jan and c:c = gas then
total column g:g and ignore all other months.

"BCOz" wrote:

a:a has is a range of monthly purchases and c:c is which month purchased. I
would like on a different sheet to calculate only those gas purchases in
january (automatically).
I tried this but did not succeed:

=IF(AND(Transactions!A:A=A:A,Transactions!C:C="gas oline"),SUM(Transactions!G:G),0)


JR

if a:a (range) equals january and c:c equals gas then add g:g ($)
 
I assume you are setup like this
A B C
25.00 Gas Jan
So, what you could do in D is type =B1&C1 for the result "GasJan"...copy the
formula down the page. On the other sheet, type "GasJan", or use a formula
as above. Now all you have to do is use a SUMIF formula that "looks for"
GasJan in col. D and sums col. A.
"BCOz" wrote:

a:a has is a range of monthly purchases and c:c is which month purchased. I
would like on a different sheet to calculate only those gas purchases in
january (automatically).
I tried this but did not succeed:

=IF(AND(Transactions!A:A=A:A,Transactions!C:C="gas oline"),SUM(Transactions!G:G),0)



All times are GMT +1. The time now is 10:36 PM.

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