Comparing Dates to see if they are in the same month and then adding them

BoggleJ

New Member
Joined
Jun 17, 2021
Messages
14
Platform
  1. Windows
So for my work I am trying to make an Excel spreadsheet for my sales job. We get paid based on the number of closings in the month from previous sales, and our pay tier is based on the number of sales in the same month we get of closings. So I am trying to compare the date that we first spoke with a client to when we got the sale and add each one that matches in 1 formula. This formula is as close as I got and it only returns the 1 value =IF(AND(YEAR(B7:B25000)=YEAR(P7:P25000),MONTH(B7:B25000)=MONTH(P7:P25000)),1,0). I have tried adding SUM to it to see if that works and I feel like I am either doing it wrong i tried this =IF(SUM(AND(YEAR(B7:B25000)=YEAR(P7:P25000),MONTH(B7:B25000)=MONTH(P7:P25000)),1,0)). Can someone help me out with this?
 
Here is what it looks like with the applied formulas and where I am having a problem I am clearly missing something
 

Attachments

  • xl5.JPG
    xl5.JPG
    98.6 KB · Views: 2
  • xl6.JPG
    xl6.JPG
    115.1 KB · Views: 2
  • xl7.JPG
    xl7.JPG
    112 KB · Views: 4
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
With the formula I gave you, it works on the current date and the date below, so..
Count number of times there is an occorance where anything in B is bigger than AD6 and the same row returning a true has a date less than AD7
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,643
Members
449,093
Latest member
Ahmad123098

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