sumproduct+countif+sumif

kelvin_9

Active Member
Joined
Mar 6, 2015
Messages
444
Office Version
  1. 2019
greeting to all,

i am not very good at excel formula, with my data(A1:C19) below

i have to extract the date and time to date only(E2:E19), and then remove duplicate(F2:F3), to calculate the number of order SN(G2:G3)

however, i was wondering, if this 3 formula can be worked(J2:K6) at same time
ps: lower right corner is my expected answer

Mrh Online - Order with SOH (Prompt) Production - Pick Up - Limited Store - Hourly2023-12-29-20-01-01 (002).xlsx
ABCDEFGHIJK
1Order SnUpdated AtLocation Translations.TitleUpdated AtUpdated AtOrder SnLocation Translations.Title12/29/202312/28/2023
223122012181247290812/29/202311112/29/202312/29/20236111
323122012181247290812/29/202311112/29/202312/28/20235222
423122012181247290812/29/202311112/29/2023333
523122012181247290812/29/202311112/29/2023444
623122112021075330512/29/202311112/29/2023555
723122112041678641312/29/202322212/29/2023
823122112044492327912/29/202333312/29/2023
923122112061887234512/29/202344412/29/2023
1023122112173964697812/29/202344412/29/2023
1123122112274392043912/28/202311112/28/2023
1223122112274392043912/28/202311112/28/2023
1323122112274392043912/28/202311112/28/2023
1423122112364830432212/28/202322212/28/2023Location Translations.Title12/29/202312/28/2023
1523122112590730557512/28/202333312/28/202311121
1623122113293850664312/28/202344412/28/202322211
1723122113293850664312/28/202344412/28/202333311
1823122113293850664312/28/202344412/28/202344421
1923122113343088138112/28/202355512/28/202355501
Sheet1
Cell Formulas
RangeFormula
J1J1=F2
K1K1=F3
G2G2=SUMPRODUCT((A2:A10<>"")/COUNTIF(A2:A10,A2:A10&""))
G3G3=SUMPRODUCT((A11:A19<>"")/COUNTIF(A11:A19,A11:A19&""))
E2:E19E2=INT(B2)


thank you very much for your answering
 
The alternative using formulas is more involved, as you'll need to create the unique row and column headings, and then that table layout can be populated with a counting formula...I've adopted the version offered by @Phuoc. The rows and column heading formulas are entered in the first cell and then dragged across or down until blanks are returned, indicating all unique values are accounted for. Then the counting formula is copied throughout the table. I still prefer Power Query for this, but it's good to have options.
MrExcel_20231231.xlsx
MNOP
1Location Translations.Title12/29/202312/28/2023 
211121
322211
433311
544421
655501
7 
Sheet4
Cell Formulas
RangeFormula
N1:P1N1=IFERROR(INDEX(INT($B$2:$B$19),MATCH(0,INDEX(COUNTIF($M$1:M1,INT($B$2:$B$19)),0),0)),"")
N2:O6N2=COUNT(1/(ROW($A$2:$A$19)-1=MATCH($A$2:$A$19&N$1&$M2,$A$2:$A$19&INT($B$2:$B$19)&$C$2:$C$19,0)))
M2:M7M2=IFERROR(INDEX($C$2:$C$19,MATCH(0,INDEX(COUNTIF($M$1:M1,$C$2:$C$19),0),0)),"")
thank you very much for your reply, KRice

formula at N1 and M2 is really save my life

thank you very much
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Here is another idea for the data table formula:
MrExcel_20231231.xlsx
MNO
1Location Translations.Title12/29/202312/28/2023
211121
322211
433311
544421
655501
Sheet4
Cell Formulas
RangeFormula
N1:O1N1=IFERROR(INDEX(INT($B$2:$B$19),MATCH(0,INDEX(COUNTIF($M$1:M1,INT($B$2:$B$19)),0),0)),"")
M2:M6M2=IFERROR(INDEX($C$2:$C$19,MATCH(0,INDEX(COUNTIF($M$1:M1,$C$2:$C$19),0),0)),"")
N2:O6N2=SUM(IF(FREQUENCY(IF((INT($B$2:$B$19)=N$1)*($C$2:$C$19=$M2),$A$2:$A$19,""),IF((INT($B$2:$B$19)=N$1)*($C$2:$C$19=$M2),$A$2:$A$19,""))>0,1))
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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