Macro that can Add A weeks worth of data from the day in put in a cell?

Sonythenovice

New Member
Joined
Mar 15, 2016
Messages
31
Hello,
A big thank you to everyone who has helped me already today, one more question if thats ok?

I have a Sheet called "Data" that hold all the sales for each salesperson on a daily basis by date,
I want a macro that can add up the sales each person has done for the week from a date i put into a cell.

So to describe my data sheet "Data"

B8:ABE8 are the dates entered as DD/MM/YYYY
B11:ABE31 is all the sales made by each salesperson,
for example Tomas is B11:ABE11
and Susan is B12:ABE12
the sales person names will always be in the same rows so it ok to assume that if Tomas is in Row 11 all the data in row 11 is for him.
I also have another tab called "Reports"

In reports down column A I have all the sales persons names starting at A11 (the names are in the same order as the "Data" tab so you can assume A11 will be Tomas, A12 Susan etc.
in Cell B8 I input a date for example 21/08/2015
I would like a macro that could look along Sheet "Data" Row 8 and Find the date that matches "Reports" B8's date, then add up each row's sales for the last 7 days including that day and insert it into Reports Column B from B11:B31

if anyone has any ideas how i can do this i'd be very greatful

Thanks

Simple Example of what I need using a few dates and a few names

Sheet DATA:

ABCDEFGHIJKLMNOPQRSTUVWX
8Date12/05/201513/05/201514/05/201515/05/201516/05/201517/05/201518/05/201519/05/201520/05/201521/05/201522/05/201523/05/201524/05/201525/05/201526/05/201527/05/201528/05/2015
SALESPERSONwhen it finds the date it will look back 7 days then add the amount for each salesperson and put the total into results sheet column B
11Tomas105335599995610110020800001211
12Susan12322446510201020102010201052207
13John0000023275010020030010020030001212345

<tbody>
</tbody>











Sheet Result:
ABCDEFGHI
823/05/2015so the macro will take the date from B8 and find it in the data sheet from row 8
Totals Sales For Week
11Tomas3290
12Susan110
13John800

<tbody>
</tbody>
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,214,386
Messages
6,119,214
Members
448,874
Latest member
b1step2far

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