Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
spepperchin
 
Posts: n/a
Default How do I sum a column based on another column

I am trying to sum grades for a class. When recording the grades I have a
grade for in class and one for homework so the column headings alternate
between the date, HW(for homework) and a possible column for projects. I
want to total each of the three types of grades seperately so I need to use
the column heading to determine if the column is added and it is fine for the
HW and project columns but I want to write the equation so that the in class
grade is added if the heading is a date. I hope this makes sense.
  #2   Report Post  
B. R.Ramachandran
 
Posts: n/a
Default How do I sum a column based on another column

Hi,

You could use the fact that dates (column headings for InClass grades) are
numbers while the other two column headings (HW and Project) are text strings.
So the summing criterion could be,
"ISNUMBER(headings-range)". This would return TRUE for InClass and FALSE
for HW and Project.

So the formula could be something like,

=SUMPRODUCT(ISNUMBER($B$2:$M$2)*(B3:M3))

The formula would add grades in B3:M3 from only those columns for which the
column headings (B2:M2) happen to be dates (and exclude those for which
column headings are not dates).

I don't know what kind of formulas you are using for summing up HW and P
grades. The following formulas would also work.

=SUMPRODUCT(($B$2:$M$2="HW")*(B3:M3))
=SUMPRODUCT(($B$2:$M$2="P")*(B3:M3))


Regards,
B. R. Ramachandran

"spepperchin" wrote:

I am trying to sum grades for a class. When recording the grades I have a
grade for in class and one for homework so the column headings alternate
between the date, HW(for homework) and a possible column for projects. I
want to total each of the three types of grades seperately so I need to use
the column heading to determine if the column is added and it is fine for the
HW and project columns but I want to write the equation so that the in class
grade is added if the heading is a date. I hope this makes sense.

  #3   Report Post  
spepperchin
 
Posts: n/a
Default How do I sum a column based on another column


I tried that but it didn't work. When I tried it I was given an error
message.
I've made it work but I wan't to make it easier to add more columns so what
I've done gives the answer but will be very tedious as the year progresses.
Thanks for the post though.

"B. R.Ramachandran" wrote:

Hi,

You could use the fact that dates (column headings for InClass grades) are
numbers while the other two column headings (HW and Project) are text strings.
So the summing criterion could be,
"ISNUMBER(headings-range)". This would return TRUE for InClass and FALSE
for HW and Project.

So the formula could be something like,

=SUMPRODUCT(ISNUMBER($B$2:$M$2)*(B3:M3))

The formula would add grades in B3:M3 from only those columns for which the
column headings (B2:M2) happen to be dates (and exclude those for which
column headings are not dates).

I don't know what kind of formulas you are using for summing up HW and P
grades. The following formulas would also work.

=SUMPRODUCT(($B$2:$M$2="HW")*(B3:M3))
=SUMPRODUCT(($B$2:$M$2="P")*(B3:M3))


Regards,
B. R. Ramachandran

"spepperchin" wrote:

I am trying to sum grades for a class. When recording the grades I have a
grade for in class and one for homework so the column headings alternate
between the date, HW(for homework) and a possible column for projects. I
want to total each of the three types of grades seperately so I need to use
the column heading to determine if the column is added and it is fine for the
HW and project columns but I want to write the equation so that the in class
grade is added if the heading is a date. I hope this makes sense.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional format based on data from another column Ellie Excel Discussion (Misc queries) 3 May 14th 08 05:23 PM
Program Column B to record numerical range based on number in colm Nikole Excel Discussion (Misc queries) 2 August 17th 05 08:37 PM
increment a column based on information in another column dhemlinger New Users to Excel 2 May 25th 05 09:47 PM
Count based on another column Chance224 Excel Discussion (Misc queries) 1 March 4th 05 04:33 PM
Formula to compare multiple rows values based on another column? Murph Excel Worksheet Functions 4 February 21st 05 02:44 AM


All times are GMT +1. The time now is 04:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"