Help Writing Function

J

JamesEXCELhelp

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
 
F

FSt1

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

regards
FSt1
 
T

T. Valko

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
 
J

JamesEXCELhelp

Thanks this worked perfect

T. Valko said:
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
 
J

JamesEXCELhelp

Thanks this worked perfect

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

regards
FSt1
 
J

JamesEXCELhelp

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

T. Valko

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"),"food/gas",INDIRECT("'01-"&TEXT(ROW(INDIRECT("3:31")),"00")&"'!C:C")))

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top