SUMIF & OFFSET help please..

Bravo2003

Active Member
Joined
Apr 1, 2010
Messages
278
Office Version
  1. 365
Platform
  1. Windows
Hi, I can't get my head around Offset when in a Sumif formula:

Details:
'Cover Sheet' - A19 = Jan / A20 = Feb / A21 = Mar / etc...

Need B19 to look up on 'Workings!' to find Jan sales against code "8871"
Then also B20 to find Feb... etc..

'Workings' is set up:
F1 = Jan / G1 = Feb / etc..
Column C = code to match (e.g.'8871') the codes are various and start from row 2 to infinity..
Sales figures per code / month start in F1
eg.
F1 = code 7777 sales for Jan
G2 for Feb, etc..

F7 = Jan sales for code 8871 (just for reference)

I'm trying the formula as:
=SUMIF(Workings!C:C,"8871",OFFSET(Workings!F:F,0,0))
But i don't know what row,column info to use?
Formula to go in B19 (Jan) then populate down to B30 (Dec)

Any advice?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hello Bravo2003,

There appears to be an inconsistency in you data.
Workings' is set up:
F1 = Jan / G1 = Feb / etc..
Column C = code to match (e.g.'8871') the codes are various and start from row 2 to infinity..
Sales figures per code / month start in F1
eg.
F1 = code 7777 sales for Jan
G2 for Feb, etc..
How can F1 be both Jan and 7777 ?

Sincerely,
Leith Ross
 
Upvote 0
Hello Bravo2003,

As I read it, column "C" holds the codes and column "F" holds the sales or is it the reverse?
 
Upvote 0
Try this approach:

C13 =SUMIF(B4:B9,C11,INDEX(C4:G9,0,MATCH(C12,C3:G3,0)))

<b>Excel 2002</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">Code</td><td style=";">Jan</td><td style=";">Feb</td><td style=";">Mar</td><td style=";">Apr</td><td style=";">May</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;">111</td><td style="text-align: right;;">1</td><td style="text-align: right;;">2</td><td style="text-align: right;;">3</td><td style="text-align: right;;">4</td><td style="text-align: right;;">5</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;;">111</td><td style="text-align: right;;">6</td><td style="text-align: right;;">7</td><td style="text-align: right;;">8</td><td style="text-align: right;;">9</td><td style="text-align: right;;">10</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style="text-align: right;;">222</td><td style="text-align: right;;">11</td><td style="text-align: right;;">12</td><td style="text-align: right;;">13</td><td style="text-align: right;;">14</td><td style="text-align: right;;">15</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style="text-align: right;;">222</td><td style="text-align: right;;">16</td><td style="text-align: right;;">17</td><td style="text-align: right;;">18</td><td style="text-align: right;;">19</td><td style="text-align: right;;">20</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style="text-align: right;;">333</td><td style="text-align: right;;">21</td><td style="text-align: right;;">22</td><td style="text-align: right;;">23</td><td style="text-align: right;;">24</td><td style="text-align: right;;">25</td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style="text-align: right;;">333</td><td style="text-align: right;;">26</td><td style="text-align: right;;">27</td><td style="text-align: right;;">28</td><td style="text-align: right;;">29</td><td style="text-align: right;;">30</td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style=";">Lookup code</td><td style="text-align: right;;">222</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style=";">Lookup month</td><td style="text-align: right;;">Mar</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">13</td><td style=";">Sum</td><td style="text-align: right;;">31</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet1</p><br /><br />
 
Upvote 0
Maybe this:

<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">18</td><td style="font-weight: bold;;">Month\Code</td><td style="font-weight: bold;text-align: right;;">8871</td><td style="font-weight: bold;text-align: right;;">8872</td><td style="font-weight: bold;text-align: right;;">8873</td></tr><tr ><td style="color: #161120;text-align: center;">19</td><td style="font-weight: bold;;">Jan</td><td style="text-align: right;;">373</td><td style="text-align: right;;">880</td><td style="text-align: right;;">748</td></tr><tr ><td style="color: #161120;text-align: center;">20</td><td style="font-weight: bold;;">Feb</td><td style="text-align: right;;">254</td><td style="text-align: right;;">517</td><td style="text-align: right;;">395</td></tr><tr ><td style="color: #161120;text-align: center;">21</td><td style="font-weight: bold;;">Mar</td><td style="text-align: right;;">659</td><td style="text-align: right;;">800</td><td style="text-align: right;;">174</td></tr><tr ><td style="color: #161120;text-align: center;">22</td><td style="font-weight: bold;;">Apr</td><td style="text-align: right;;">276</td><td style="text-align: right;;">853</td><td style="text-align: right;;">721</td></tr></tbody></table><p style="width:6.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Cover Sheet</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B19</th><td style="text-align:left">=INDEX(<font color="Blue">Workings!$F$2:$Q$7,MATCH(<font color="Red">B$18,Workings!$B$2:$B$7,0</font>),MATCH(<font color="Red">$A19,Workings!$F$1:$Q$1,0</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
Markmzz
 
Upvote 0
Hello Bravo2003,

Thanks for clearing that up. It appears you have 2 answers to your question already. I don't think a third will be necessary.

Sincerely,
Leith Ross
 
Upvote 0
Or try this:

<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">18</td><td style="font-weight: bold;;">Month\Code</td><td style="font-weight: bold;text-align: right;;">8871</td><td style="font-weight: bold;text-align: right;;">8872</td></tr><tr ><td style="color: #161120;text-align: center;">19</td><td style="font-weight: bold;;">Jan</td><td style="text-align: right;;">400</td><td style="text-align: right;;">200</td></tr><tr ><td style="color: #161120;text-align: center;">20</td><td style="font-weight: bold;;">Feb</td><td style="text-align: right;;">1600</td><td style="text-align: right;;">800</td></tr><tr ><td style="color: #161120;text-align: center;">21</td><td style="font-weight: bold;;">Mar</td><td style="text-align: right;;">2800</td><td style="text-align: right;;">1400</td></tr><tr ><td style="color: #161120;text-align: center;">22</td><td style="font-weight: bold;;">Apr</td><td style="text-align: right;;">4000</td><td style="text-align: right;;">2000</td></tr></tbody></table><p style="width:6.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Cover Sheet</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">B19</th><td style="text-align:left">=SUMPRODUCT(<font color="Blue">(<font color="Red">Workings!$F$2:$Q$7</font>)*(<font color="Red">Workings!$F$1:$Q$1=$A19</font>)*(<font color="Red">Workings!$B$2:$B$7=B$18</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
Markmzz
 
Upvote 0
Or try this:

Excel 2007<TABLE style="BORDER-BOTTOM: #a6aab6 1px solid; BORDER-LEFT: #a6aab6 1px solid; BACKGROUND-COLOR: #ffffff; BORDER-COLLAPSE: collapse; BORDER-TOP: #a6aab6 1px solid; BORDER-RIGHT: #a6aab6 1px solid" rules=all cellPadding=2><COLGROUP><COL style="BACKGROUND-COLOR: #e0e0f0" width=25><COL><COL><COL></COLGROUP><THEAD><TR style="TEXT-ALIGN: center; BACKGROUND-COLOR: #e0e0f0; COLOR: #161120"><TH></TH><TH>A</TH><TH>B</TH><TH>C</TH></TR></THEAD><TBODY><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">18</TD><TD style="FONT-WEIGHT: bold">Month\Code</TD><TD style="TEXT-ALIGN: right; FONT-WEIGHT: bold">8871</TD><TD style="TEXT-ALIGN: right; FONT-WEIGHT: bold">8872</TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">19</TD><TD style="FONT-WEIGHT: bold">Jan</TD><TD style="TEXT-ALIGN: right">400</TD><TD style="TEXT-ALIGN: right">200</TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">20</TD><TD style="FONT-WEIGHT: bold">Feb</TD><TD style="TEXT-ALIGN: right">1600</TD><TD style="TEXT-ALIGN: right">800</TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">21</TD><TD style="FONT-WEIGHT: bold">Mar</TD><TD style="TEXT-ALIGN: right">2800</TD><TD style="TEXT-ALIGN: right">1400</TD></TR><TR><TD style="TEXT-ALIGN: center; COLOR: #161120">22</TD><TD style="FONT-WEIGHT: bold">Apr</TD><TD style="TEXT-ALIGN: right">4000</TD><TD style="TEXT-ALIGN: right">2000</TD></TR></TBODY></TABLE>
Cover Sheet


<TABLE style="BORDER-BOTTOM: black 2px solid; BORDER-LEFT: black 2px solid; PADDING-BOTTOM: 0.4em; BACKGROUND-COLOR: #ffffff; PADDING-LEFT: 0.4em; PADDING-RIGHT: 0.4em; BORDER-COLLAPSE: collapse; BORDER-TOP: black 2px solid; BORDER-RIGHT: black 2px solid; PADDING-TOP: 0.4em" rules=all cellPadding=2 width="85%"><TBODY><TR><TD style="PADDING-BOTTOM: 6px; PADDING-LEFT: 6px; PADDING-RIGHT: 6px; PADDING-TOP: 6px">Worksheet Formulas<TABLE style="BORDER-BOTTOM: #a6aab6 1px solid; TEXT-ALIGN: center; BORDER-LEFT: #a6aab6 1px solid; BACKGROUND-COLOR: #ffffff; BORDER-COLLAPSE: collapse; BORDER-TOP: #a6aab6 1px solid; BORDER-RIGHT: #a6aab6 1px solid" rules=all cellPadding=2 width="100%"><THEAD><TR style="BACKGROUND-COLOR: #e0e0f0; COLOR: #161120"><TH width=10>Cell</TH><TH style="TEXT-ALIGN: left; PADDING-LEFT: 5px">Formula</TH></TR></THEAD><TBODY><TR><TH style="BACKGROUND-COLOR: #e0e0f0; COLOR: #161120" width=10>B19</TH><TD style="TEXT-ALIGN: left">=SUMPRODUCT((Workings!$F$2:$Q$7)*(Workings!$F$1:$Q$1=$A19)*(Workings!$B$2:$B$7=B$18))</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>

Markmzz

Thanks for the help, but problem is I import the data in the working sheet and the date will not always match the cover sheet date layout..

I think I've found a solution, but not one I can copy and paste, but it's working for now..

Is there a way I can get
=SUMIF(Workings!$C:$C,B$18,OFFSET(Workings!$F:$F,0,0))
the last '0' in this formula to add on 1 each time I drag it down a row?
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,629
Members
452,933
Latest member
patv

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