Help which function to use!?!?

jamesnimmo

New Member
Joined
Dec 3, 2010
Messages
7
Hi I am trying to create an ongoing update-able spreadsheet based of an sql data table, my data looks like the below,

[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer No_[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111"]Posting Date[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 112"]
<tbody>[TR]
[TD="class: xl65, width: 112"]Sales[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]02/01/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]394[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]15/01/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]17/01/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]01/02/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]5000[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]02/02/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]250[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]15/02/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]650[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]17/02/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]900[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]22/02/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]403[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]02/03/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]260[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]15/12/2012 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]970[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]17/03/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]54[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]22/03/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]69[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]02/04/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]78[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]02/04/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]365[/TD]
[/TR]
[TR]
[TD][TABLE="width: 96"]
<tbody>[TR]
[TD="class: xl65, width: 96"]Customer 2[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 111"]
<tbody>[TR]
[TD="class: xl65, width: 111, align: right"]05/04/2013 00:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]996[/TD]
[/TR]
</tbody>[/TABLE]

I am trying to create a sheet that then looks at this table, (it has a vast number of rows that will expand as refreshed), see example. I need the formula to look at the table and return the sum of the sales during the given month to the corresponding cell.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Customer No[/TD]
[TD]December 2012 sales[/TD]
[TD]January 2013 Sales[/TD]
[TD]February 2013 Sales[/TD]
[TD]March 2013 Sales[/TD]
[TD]April 2013 Sales[/TD]
[/TR]
[TR]
[TD]Customer 1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Customer 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Customer 3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

I dont think i need a pivot table but any suggestions would be helpful, i have tried a sumproduct but can't get it to work with date ranges.

Any Help would be great,thanks in anticipation.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
I was able to get this to work:
Assume your data is in A2:C20 (Col A is Customer, B is Date, C is Sales Amnt)
At cell F2 enter a Customer name
At Cell G1 enter in the last day of a given month...say 1/31/2013
At cell G2 enter the following formula:
=SUMIFS($C$2:$C$20,$A$2:$A$20,$F2,$B$2:$B$20,">="&DATE(YEAR(G$1),MONTH(G$1),1),$B$2:$B$20,"<="&G$1)
 
Upvote 0
What happens if somebody adds a new customer to the database? That means somebody has to manually add the customer to the table and extend the formulas. The same is true as time passes and you want to add months. Pivot tables deal with new data automatically.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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