How to count Specific name for a Specific Date Range

Seifeddine87

Board Regular
Joined
Sep 7, 2015
Messages
96
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

ABCDEFGHI
1CodeDateStock NoProfitStart Date End Date
2311905/04/19
405501/04/1901/05/19
3449505/04/197556
4449705/04/1940452Stock NoSold itemsProfit
5466206/04/19541240=?????=?????
6358007/04/194525751
56
7444608/04/1945120452145
8378308/05/19453054112
9155208/05/194038
10855608/05/197575

<tbody>
</tbody>
 

Seifeddine87

Board Regular
Joined
Sep 7, 2015
Messages
96
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
Joined
Apr 18, 2011
Messages
35,501
Office Version
2010
Platform
Windows
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:

Forum statistics

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

Some videos you may like

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...
Top