Charts using every other column

gavinbox

New Member
Joined
Aug 29, 2009
Messages
3
I've a file which is data from our POS till system.
Attached is apportion of it and I'd like to know how I can extract sales data that is useful.
I want to see only quantities sold, not value (for example column G, not column H).
How do I make a chart that would show me that for each product, and could I then make one for each category, or just products within.

Ideally I'll be able to simply bolt onto the end of one worksheet, new data as I extract it from the till, paste it on the end, and have the charts update automatically.

Thanks for any help,

Gavin

Sat 02/01/2014Sun 02/02/2014Mon 02/03/2014Tue 02/04/2014
NameSKUBarcodeCategorySubcategoryQuantityTotalQuantityTotalQuantityTotalQuantityTotal
1kg Round Hill El Chollo1E+09RETAILCoffee
Alm croiss1112511125FOODBreakfast1023.6102461436.8
Choc croiss1112011120FOODBreakfast8161020716714
Egg & Coppa Bap1E+09FOODBreakfast411.67823.33823.33311.67
Egg & Veg Bap1E+09FOODBreakfast38.525.6738.5411.33
HAM cheese F1112111121FOODBreakfast12.725.412.7
Ham cheese T1112611126FOODBreakfast715.7524.536.7549
Plain croiss1112411124FOODBreakfast69.6710.6769.33710.67
TOMATO cheese F1E+09FOODBreakfast24.824.8
TOMATO cheese T1E+09FOODBreakfast510482424
Yog Gran1112211122FOODBreakfast614.5716.92819.33310.67
Cake small1112911129FOODCakes12.5
Doughnut1113311133FOODCakes1744.17512.5
Frangipane1113111131FOODCakes410.4
Loaf1112811128FOODCakes511.520461839.871125.3
Mandarin Choc1113211132FOODCakes12.9

<colgroup><col span="13"></colgroup><tbody>
</tbody>
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
I think the easiest is to use a user defined function (UDF) to get your sums for every other column.

To create our UDF, press Alt-F8.
in the dialog box at the top type in 'SumEvery2Columns' (without the ')
The button to the right will change to a 'Create' button.
Press it. The VBA editor opens with a skelton macro in the right pane.

Delete everything and replace it with:

<See post below for the correct function>

If your product name is in column A, and your first date starts in column G then insert a column infront of G, so that the first date now starts in F.
Now in G3 (your first product row) put:
=SumEvery2Columns(F3)
copy the formula down for all your products.

Now you can use this for graphing your product sales. if you add a new date, the sums will automatically be updated
 
Upvote 0
Sorry, noticed an error in the function.

So put this function in the VBA editor:

<font face=Courier New><SPAN style="color:#00007F">Option</SPAN> <SPAN style="color:#00007F">Explicit</SPAN><br><br><br><br><SPAN style="color:#00007F">Function</SPAN> SumEvery2Columns(rStart <SPAN style="color:#00007F">As</SPAN> Range) <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Variant</SPAN><br><SPAN style="color:#007F00">'returns the sum of every other cell on the row of rStart _<br> and starting at rStart.</SPAN><br><SPAN style="color:#007F00">'</SPAN><br><SPAN style="color:#007F00">' Usage: =SumEvery2Columns(F4)</SPAN><br><SPAN style="color:#007F00">'   this will give the sum of F4, H4, J4, L4, etc to the last column in use</SPAN><br><SPAN style="color:#007F00">'   Text is ignored</SPAN><br>    <br>    <SPAN style="color:#00007F">Dim</SPAN> lC <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN>, lCLast <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN><br>    <br>    Application.Volatile<br>    <SPAN style="color:#00007F">With</SPAN> rStart<br>        lCLast = .Parent.Cells(.Row, Columns.Count).End(xlToLeft).Column<br>        <br>        <SPAN style="color:#00007F">For</SPAN> lC = 0 <SPAN style="color:#00007F">To</SPAN> lCLast - .Column <SPAN style="color:#00007F">Step</SPAN> 2<br>            <SPAN style="color:#00007F">If</SPAN> IsNumeric(.Offset(0, lC)) <SPAN style="color:#00007F">Then</SPAN><br>                SumEvery2Columns = SumEvery2Columns + .Offset(0, lC)<br>            <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>        <SPAN style="color:#00007F">Next</SPAN> lC<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Function</SPAN></FONT>
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,777
Members
449,049
Latest member
greyangel23

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