ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Help Writing Function (https://www.excelbanter.com/excel-worksheet-functions/171615-help-writing-function.html)

JamesEXCELhelp

Help Writing Function
 
I have a list of dollar values listed in column A. I have assign a category
in column B to each of them. I want to add them by category.

So for an example:

A1 = 10.00 B1= Rent
A2 = 25.00 B2= Gas
A3 = 5.00 B3 = Rent
A4 = 100.00 B4= Gas

Now I want to say - Add Rent and give me the total in C12.
Add Gas and give me the total in C13.

Please help

Thanks




FSt1

Help Writing Function
 
hi
sumif should work for you
=SUMIF(B1:B4,"gas",A1:A4)
you will need a sumif formula for each catagory.

regards
FSt1

"JamesEXCELhelp" wrote:

I have a list of dollar values listed in column A. I have assign a category
in column B to each of them. I want to add them by category.

So for an example:

A1 = 10.00 B1= Rent
A2 = 25.00 B2= Gas
A3 = 5.00 B3 = Rent
A4 = 100.00 B4= Gas

Now I want to say - Add Rent and give me the total in C12.
Add Gas and give me the total in C13.

Please help

Thanks




T. Valko

Help Writing Function
 
Try it like this:

=SUMIF(B1:B4,"Rent",A1:A4)
=SUMIF(B1:B4,"Gas",A1:A4)

Or, suppose you have in B12:B13 - Rent, Gas

Then, in C12:

=SUMIF(B$1:B$4,B12,A$1:A$4)

Copy down to C13


--
Biff
Microsoft Excel MVP


"JamesEXCELhelp" wrote in message
...
I have a list of dollar values listed in column A. I have assign a category
in column B to each of them. I want to add them by category.

So for an example:

A1 = 10.00 B1= Rent
A2 = 25.00 B2= Gas
A3 = 5.00 B3 = Rent
A4 = 100.00 B4= Gas

Now I want to say - Add Rent and give me the total in C12.
Add Gas and give me the total in C13.

Please help

Thanks






JamesEXCELhelp

Help Writing Function
 
Thanks this worked perfect

"T. Valko" wrote:

Try it like this:

=SUMIF(B1:B4,"Rent",A1:A4)
=SUMIF(B1:B4,"Gas",A1:A4)

Or, suppose you have in B12:B13 - Rent, Gas

Then, in C12:

=SUMIF(B$1:B$4,B12,A$1:A$4)

Copy down to C13


--
Biff
Microsoft Excel MVP


"JamesEXCELhelp" wrote in message
...
I have a list of dollar values listed in column A. I have assign a category
in column B to each of them. I want to add them by category.

So for an example:

A1 = 10.00 B1= Rent
A2 = 25.00 B2= Gas
A3 = 5.00 B3 = Rent
A4 = 100.00 B4= Gas

Now I want to say - Add Rent and give me the total in C12.
Add Gas and give me the total in C13.

Please help

Thanks







JamesEXCELhelp

Help Writing Function
 
Thanks this worked perfect

"FSt1" wrote:

hi
sumif should work for you
=SUMIF(B1:B4,"gas",A1:A4)
you will need a sumif formula for each catagory.

regards
FSt1

"JamesEXCELhelp" wrote:

I have a list of dollar values listed in column A. I have assign a category
in column B to each of them. I want to add them by category.

So for an example:

A1 = 10.00 B1= Rent
A2 = 25.00 B2= Gas
A3 = 5.00 B3 = Rent
A4 = 100.00 B4= Gas

Now I want to say - Add Rent and give me the total in C12.
Add Gas and give me the total in C13.

Please help

Thanks




JamesEXCELhelp

Help Writing Function
 
One more Question!

If I have created multi-tabs in my excel spreadsheet. For example:

tab for 01-03, then the next tab for 01-04, and so fourth.

Now I have implemented =SUMIF('01-03'!E:E,"Food/Gas",'01-03'!C:C)

Checking the entire column E for Food/Gas and addind Values in column C.

Now I want to modify the equation for each tab.

Can I do something like
=SUMIF('01-03:01-31'!E:E,"Food/Gas",'01-03:01-31'!C:C)?

I could not get this to work?

Thanks Again

"T. Valko" wrote:

Try it like this:

=SUMIF(B1:B4,"Rent",A1:A4)
=SUMIF(B1:B4,"Gas",A1:A4)

Or, suppose you have in B12:B13 - Rent, Gas

Then, in C12:

=SUMIF(B$1:B$4,B12,A$1:A$4)

Copy down to C13


--
Biff
Microsoft Excel MVP


"JamesEXCELhelp" wrote in message
...
I have a list of dollar values listed in column A. I have assign a category
in column B to each of them. I want to add them by category.

So for an example:

A1 = 10.00 B1= Rent
A2 = 25.00 B2= Gas
A3 = 5.00 B3 = Rent
A4 = 100.00 B4= Gas

Now I want to say - Add Rent and give me the total in C12.
Add Gas and give me the total in C13.

Please help

Thanks







T. Valko

Help Writing Function
 
Can I do something like
=SUMIF('01-03:01-31'!E:E,"Food/Gas",'01-03:01-31'!C:C)?


Unfortunately, it becomes *much* more complicated.

Try this:

=SUMPRODUCT(SUMIF(INDIRECT("'01-"&TEXT(ROW(INDIRECT("3:31")),"00")&"'!E:E"),"f ood/gas",INDIRECT("'01-"&TEXT(ROW(INDIRECT("3:31")),"00")&"'!C:C")))

This will work on sheets 01-03 through 01-31

--
Biff
Microsoft Excel MVP


"JamesEXCELhelp" wrote in message
...
One more Question!

If I have created multi-tabs in my excel spreadsheet. For example:

tab for 01-03, then the next tab for 01-04, and so fourth.

Now I have implemented =SUMIF('01-03'!E:E,"Food/Gas",'01-03'!C:C)

Checking the entire column E for Food/Gas and addind Values in column C.

Now I want to modify the equation for each tab.

Can I do something like
=SUMIF('01-03:01-31'!E:E,"Food/Gas",'01-03:01-31'!C:C)?

I could not get this to work?

Thanks Again

"T. Valko" wrote:

Try it like this:

=SUMIF(B1:B4,"Rent",A1:A4)
=SUMIF(B1:B4,"Gas",A1:A4)

Or, suppose you have in B12:B13 - Rent, Gas

Then, in C12:

=SUMIF(B$1:B$4,B12,A$1:A$4)

Copy down to C13


--
Biff
Microsoft Excel MVP


"JamesEXCELhelp" wrote in
message
...
I have a list of dollar values listed in column A. I have assign a
category
in column B to each of them. I want to add them by category.

So for an example:

A1 = 10.00 B1= Rent
A2 = 25.00 B2= Gas
A3 = 5.00 B3 = Rent
A4 = 100.00 B4= Gas

Now I want to say - Add Rent and give me the total in C12.
Add Gas and give me the total in C13.

Please help

Thanks









JamesEXCELhelp

Help Writing Function
 
WOW!

I have no idea why it works but it does!

Thank Again

"T. Valko" wrote:

Can I do something like
=SUMIF('01-03:01-31'!E:E,"Food/Gas",'01-03:01-31'!C:C)?


Unfortunately, it becomes *much* more complicated.

Try this:

=SUMPRODUCT(SUMIF(INDIRECT("'01-"&TEXT(ROW(INDIRECT("3:31")),"00")&"'!E:E"),"f ood/gas",INDIRECT("'01-"&TEXT(ROW(INDIRECT("3:31")),"00")&"'!C:C")))

This will work on sheets 01-03 through 01-31

--
Biff
Microsoft Excel MVP


"JamesEXCELhelp" wrote in message
...
One more Question!

If I have created multi-tabs in my excel spreadsheet. For example:

tab for 01-03, then the next tab for 01-04, and so fourth.

Now I have implemented =SUMIF('01-03'!E:E,"Food/Gas",'01-03'!C:C)

Checking the entire column E for Food/Gas and addind Values in column C.

Now I want to modify the equation for each tab.

Can I do something like
=SUMIF('01-03:01-31'!E:E,"Food/Gas",'01-03:01-31'!C:C)?

I could not get this to work?

Thanks Again

"T. Valko" wrote:

Try it like this:

=SUMIF(B1:B4,"Rent",A1:A4)
=SUMIF(B1:B4,"Gas",A1:A4)

Or, suppose you have in B12:B13 - Rent, Gas

Then, in C12:

=SUMIF(B$1:B$4,B12,A$1:A$4)

Copy down to C13


--
Biff
Microsoft Excel MVP


"JamesEXCELhelp" wrote in
message
...
I have a list of dollar values listed in column A. I have assign a
category
in column B to each of them. I want to add them by category.

So for an example:

A1 = 10.00 B1= Rent
A2 = 25.00 B2= Gas
A3 = 5.00 B3 = Rent
A4 = 100.00 B4= Gas

Now I want to say - Add Rent and give me the total in C12.
Add Gas and give me the total in C13.

Please help

Thanks










T. Valko

Help Writing Function
 
You're welcome. Thanks for the feedback!


--
Biff
Microsoft Excel MVP


"JamesEXCELhelp" wrote in message
...
WOW!

I have no idea why it works but it does!

Thank Again

"T. Valko" wrote:

Can I do something like
=SUMIF('01-03:01-31'!E:E,"Food/Gas",'01-03:01-31'!C:C)?


Unfortunately, it becomes *much* more complicated.

Try this:

=SUMPRODUCT(SUMIF(INDIRECT("'01-"&TEXT(ROW(INDIRECT("3:31")),"00")&"'!E:E"),"f ood/gas",INDIRECT("'01-"&TEXT(ROW(INDIRECT("3:31")),"00")&"'!C:C")))

This will work on sheets 01-03 through 01-31

--
Biff
Microsoft Excel MVP


"JamesEXCELhelp" wrote in
message
...
One more Question!

If I have created multi-tabs in my excel spreadsheet. For example:

tab for 01-03, then the next tab for 01-04, and so fourth.

Now I have implemented =SUMIF('01-03'!E:E,"Food/Gas",'01-03'!C:C)

Checking the entire column E for Food/Gas and addind Values in column
C.

Now I want to modify the equation for each tab.

Can I do something like
=SUMIF('01-03:01-31'!E:E,"Food/Gas",'01-03:01-31'!C:C)?

I could not get this to work?

Thanks Again

"T. Valko" wrote:

Try it like this:

=SUMIF(B1:B4,"Rent",A1:A4)
=SUMIF(B1:B4,"Gas",A1:A4)

Or, suppose you have in B12:B13 - Rent, Gas

Then, in C12:

=SUMIF(B$1:B$4,B12,A$1:A$4)

Copy down to C13


--
Biff
Microsoft Excel MVP


"JamesEXCELhelp" wrote in
message
...
I have a list of dollar values listed in column A. I have assign a
category
in column B to each of them. I want to add them by category.

So for an example:

A1 = 10.00 B1= Rent
A2 = 25.00 B2= Gas
A3 = 5.00 B3 = Rent
A4 = 100.00 B4= Gas

Now I want to say - Add Rent and give me the total in C12.
Add Gas and give me the total in C13.

Please help

Thanks













All times are GMT +1. The time now is 04:50 PM.

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