ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How Do I DO IF with DATE (https://www.excelbanter.com/excel-worksheet-functions/193616-how-do-i-do-if-date.html)

Dig

How Do I DO IF with DATE
 
I have a workbook with 2 sheets. The first sheet has a report for individuals
sales. Each row has a date then cust name then amount from left to right.

The other sheet has a table setup to do monthly totals to figure
commissions. First is the rep name then total sales for a given month then
commission percent then commission amount from Left to Right.

What I want to do is have the TOTAL SALES in SHEET 2 look in SHEET 1 and
TOTAL all sales for say any date that has a 7 as the first number (this would
be for JULY). Obviously I have other cells that will need to look and see if
there is an 8 (AUGUST) as the first date number and so on but once I figure
the first on out it is a simple matter of repeating the process.

Can I use an IF statement or is there a better way to do this.

You help is appreciated greatly
Thanks

Gary Brown[_4_]

How Do I DO IF with DATE
 
I think you may need a cheater column with the formula '=Month(date)' and the
SumProduct function.
--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown


"Dig" wrote:

I have a workbook with 2 sheets. The first sheet has a report for individuals
sales. Each row has a date then cust name then amount from left to right.

The other sheet has a table setup to do monthly totals to figure
commissions. First is the rep name then total sales for a given month then
commission percent then commission amount from Left to Right.

What I want to do is have the TOTAL SALES in SHEET 2 look in SHEET 1 and
TOTAL all sales for say any date that has a 7 as the first number (this would
be for JULY). Obviously I have other cells that will need to look and see if
there is an 8 (AUGUST) as the first date number and so on but once I figure
the first on out it is a simple matter of repeating the process.

Can I use an IF statement or is there a better way to do this.

You help is appreciated greatly
Thanks


Sandy Mann

How Do I DO IF with DATE
 
You don't mention the Rep's name in Sheet 1 so assuming that in Sheet 1:

Column A: Rep's name
Column B: Date
Column C: Customer Name
Column D: Amount

In Sheet 2:

Column A: Rep's name
Column B:
=SUMPRODUCT((Sheet1!A2:A200=A2)*(MONTH(Sheet1!B2:B 200)=7)*Sheet1!C2:C200)

(ie A2 in Sheet2 is the Rep's name). Adjust the ranges to your requirements.


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Dig" wrote in message
...
I have a workbook with 2 sheets. The first sheet has a report for
individuals
sales. Each row has a date then cust name then amount from left to right.

The other sheet has a table setup to do monthly totals to figure
commissions. First is the rep name then total sales for a given month then
commission percent then commission amount from Left to Right.

What I want to do is have the TOTAL SALES in SHEET 2 look in SHEET 1 and
TOTAL all sales for say any date that has a 7 as the first number (this
would
be for JULY). Obviously I have other cells that will need to look and see
if
there is an 8 (AUGUST) as the first date number and so on but once I
figure
the first on out it is a simple matter of repeating the process.

Can I use an IF statement or is there a better way to do this.

You help is appreciated greatly
Thanks





All times are GMT +1. The time now is 11:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com