# How to count Specific name for a Specific Date Range

#### Seifeddine87

##### Board Regular
hi i have been trying to do this for few hours and i just give up i know you gays you could do it with your eyes closed

1) i want to know how many Specific item has been sold in Specific Date Range
2) i want to know total profit in Specific item has been sold in Specific Date Range

Example

 A B C D E F G H I 1 Code Date Stock No Profit Start Date End Date 2 3119 05/04/19 40 55 01/04/19 01/05/19 3 4495 05/04/19 75 56 4 4497 05/04/19 40 452 Stock No Sold items Profit 5 4662 06/04/19 54 12 40 =????? =????? 6 3580 07/04/19 45 25 75 1 56 7 4446 08/04/19 45 120 45 2 145 8 3783 08/05/19 45 30 54 1 12 9 1552 08/05/19 40 38 10 8556 08/05/19 75 75

<tbody>
</tbody>

#### Seifeddine87

##### Board Regular
if any one know if there is a way round it or if any one got different strategy i could use to make it happen thank you

#### Rick Rothstein

##### MrExcel MVP
Put this formula in cell F5...

=COUNTIFS(C\$2:C\$10,E5,B\$2:B\$10,">="&E\$2,B\$2:B\$10,"<="&F\$2)

and this formula in cell G5...

=SUMIFS(D\$2:D\$10,C\$2:C\$10,E5,B\$2:B\$10,">="&E\$2,B\$2:B\$10,"<="&F\$2)

and then copy them down to the end of your data.

NOTE: Change the red row numbers to a row number that is equal to or greater than the actual row number for your last data item.

Last edited:

#### Seifeddine87

##### Board Regular
thank you for your help

1,081,577
Messages
5,359,731
Members
400,545
Latest member
Damntheman30

### This Week's Hot Topics

• VBA (Userform)
Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
• List box that changes fill color
Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
• Remove duplicates and retain one. Cross-linked cases
Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
• VBA Copy and Paste With Duplicates
Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
• Macro
is it possible for a macro to run if the active cell value is different to the value above it
• IF DATE and TIME
I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...