using sum if across columns

Jod84

New Member
Joined
Jun 22, 2011
Messages
7
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
I've recently inherited a spreadsheet that admittedly has quiet a poor setup with variable going across the page rather than down but I’m stuck with it for now as I’m unable to change. What I’m trying to do is sum across columns based on column header below is a sample<o:p></o:p>
<o:p></o:p>
Var A01 A02 B01 B02
Day1 1 __5__ 7__ 11
Day2 4 __9__ 15_ 12
Day3 3 _55__ 12_ 33

Apologies for underscores but for some reason when I save thread it removes spaces in above table
Two part question and second part I’m not even sure is possible but firstly I’d like to sum all information below var (top row) so for example if var was A01 it would sum (1+4+3). Secondly if at all possible can I use left function somehow so if var starts with A it will sum both columns i.e. (1+4+3)+(5+9+55). Thanks in advance
 
Last edited:

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
I've recently inherited a spreadsheet that admittedly has quiet a poor setup with variable going across the page rather than down but I’m stuck with it for now as I’m unable to change. What I’m trying to do is sum across columns based on column header below is a sample<o:p></o:p>
<o:p></o:p>
Var A01 A02 B01 B02
Day1 1 __5__ 7__ 11
Day2 4 __9__ 15_ 12
Day3 3 _55__ 12_ 33

Apologies for underscores but for some reason when I save thread it removes spaces in above table
Two part question and second part I’m not even sure is possible but firstly I’d like to sum all information below var (top row) so for example if var was A01 it would sum (1+4+3). Secondly if at all possible can I use left function somehow so if var starts with A it will sum both columns i.e. (1+4+3)+(5+9+55). Thanks in advance
Try this...

Book1
ABCDE
2VarA01A02B01B02
3Day115711
4Day2491512
5Day33551233
6_____
7A0269___
8A77___
Sheet1

To sum for the VAR column.

Formula entered in B7:

=SUM(INDEX(B3:E5,,MATCH(A7,B2:E2,0)))

To sum the VAR columns that start with A:

This array formula** entered in B8:

=SUM(IF(LEFT(B2:E2)=A8,B3:E5))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0
Here is another option:
Excel Workbook
ABCDE
1VarAO1AO2BO1BO2
2Day 115711
3Day 2491512
4Day 33551213
5
6
7AO269
8B70
Sheet1
 
Last edited:
Upvote 0
First off thanks to both of you I've tried both and they both work appreciate it as I wasted 2 hours this morning trying to figure this out before I gave up. One more question I have which comes under the nice to have but more then happy with the response I got. This workbook has replications of the sheet i showed above for each month of the financial year Jul, Aug...Jun each has exact same columns and rows (except some months will have more days obviously but blank underneath so no issue in assuming a 31 range). Is it possible to sum across all of these in the one go instead of creating a summary sheet with a column for each month and then adding together.

Thanks

Josh
 
Upvote 0
If you have the same ranges it is possible to sum across several sheets at once. I have not tested this formula with the more complicated formulas, such as the Sumproduct or Index/Match used earlier in this thread.

Cell A1 in Sheet1 has a value of 300
Cell A1 in Sheet2 has a value of 400
Cell A1 in Sheet3 has a value of 500

Here is a formula for this:
Sheet1

<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 11pt; FONT-FAMILY: Calibri,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 115px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD> </TD><TD>A</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD style="TEXT-ALIGN: right">300</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD> </TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD>Sum all all sheets</TD></TR><TR style="HEIGHT: 18px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: right">1200</TD></TR></TBODY></TABLE>
<TABLE style="FONT-SIZE: 10pt; BORDER-LEFT-COLOR: #00ff00; BORDER-BOTTOM-COLOR: #00ff00; COLOR: #000000; BORDER-TOP-STYLE: groove; BORDER-TOP-COLOR: #00ff00; FONT-FAMILY: Arial; BORDER-RIGHT-STYLE: groove; BORDER-LEFT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-RIGHT-COLOR: #00ff00; BORDER-BOTTOM-STYLE: groove"><TBODY><TR><TD>Spreadsheet Formulas</TD></TR><TR><TD><TABLE style="FONT-SIZE: 9pt; FONT-FAMILY: Arial" cellSpacing=0 cellPadding=2 border=1><TBODY><TR style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #cacaca"><TD>Cell</TD><TD>Formula</TD></TR><TR><TD>A4</TD><TD>=SUM(Sheet1:Sheet3!A1)</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
 
Upvote 0
First off thanks to both of you I've tried both and they both work appreciate it as I wasted 2 hours this morning trying to figure this out before I gave up.
You're welcome! :cool:

One more question I have which comes under the nice to have but more then happy with the response I got. This workbook has replications of the sheet i showed above for each month of the financial year Jul, Aug...Jun each has exact same columns and rows (except some months will have more days obviously but blank underneath so no issue in assuming a 31 range). Is it possible to sum across all of these in the one go instead of creating a summary sheet with a column for each month and then adding together.

Thanks

Josh
Something like this maybe:

=SUM(July:June!A1:A31)
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,843
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top