Help needed !

stvK23

New Member
Joined
Feb 12, 2014
Messages
15
Office Version
  1. 2016
Platform
  1. Windows
Hi all

I am trying to write a formula in several cells to count unique records and to return the count of distinct records or sum of.
But not having any luck as there are variations on what I have seen and not making sense to me.

The table below provides the data.
Column 1Column 2Column 3Column 4
350350511107542477450
350350511160140
350350511179562479421
350350511249992481070
350350511261212481360
350350511273112481760
350350511273112481771
350350511273112481770
350350511321660
350350511343892483551
350350511378172484580
350350511380922484620
350350511400890
350350511408130
350350511412282485400
350350511419642485491
350350511426390
350350511475272486771
350350511511642487600
350350511522552487931
350350511545262488460
350350511568132489111
350350511568732489180
350350511607422490230
350350511610570
350350511611672490320
350350511630842490880
350350511631042490870
350350511631452490911
350350511656972491620
350350511657280
350350511681502492330
350350511703452493080
350350511714012493350
350350511727420
350350511766340
350350511773410
350350511775380


Where Column 1 = 350350, then return the count of unique or distinct records from Column 2 and not to count any blank fields in Column 2Where Column 1 = 350350, then return the count unique or distinct records from Column 3 and not to count any blank fields in Column 3Where Column 1 = 350350 and for where Column 3 are only unique or distinct where Column 4 is 1, then return the sum of Column 4 for the unique or distinct records in Column 3 where its corresponding record in Column 4 is 1 .
XYZ
The result should return 37The result should return 26The result should return 8

Would really appreciate if someone could provide the formulas for X, Y and Z, please?

Additionally, if the formula for X, Y and Z are in one sheet (lets say Worksheet 1) and the data source if from another sheet (Worksheet 2) of the same file, would the formula be different? If so, would also appreciate to know how the formula is to be written?

Thanks to you all in advance.

S
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
What version of Excel are you using?
Please update your account details as it affects which functions you can use.
 
Upvote 0
Ok, how about
+Fluff New.xlsm
ABCDEFGHI
1Column 1Column 2Column 3Column 4XYZ
235035051110754247745035035036268
3350350511160140
4350350511179562479421
5350350511249992481070
6350350511261212481360
73503502481760
8350350511273112481771
9350350511273112481770
10350350511321660
11350350511343892483551
12350350511378172484580
13350350511380922484620
14350350511400890
15350350511408130
16350350511412282485400
17350350511419642485491
18350350511426390
19350350511475272486771
20350350511511642487600
21350350511522552487931
22350350511545262488460
23350350511568132489111
24350350511568732489180
25350350511607422490230
26350350511610570
27350350511611672490320
28350350511630842490880
29350350511631042490870
30350350511631452490911
31350350511656972491620
32350350511657280
33350350511681502492330
34350350511703452493080
35350350511714012493350
36350350511727420
37350350511766340
38350350511773410
39350350511775380
Contacts
Cell Formulas
RangeFormula
G2G2=SUM(--(FREQUENCY(IF(A2:A39=F2,B2:B39),B2:B39)>0))
H2H2=SUM(--(FREQUENCY(IF(A2:A39=F2,C2:C39),C2:C39)>0))
I2I2=SUM(--(FREQUENCY(IF(A2:A39=F2,IF(D2:D39=1,B2:B39)),B2:B39)>0))
Press CTRL+SHIFT+ENTER to enter array formulas.


Please don't forget to update your account details & then scroll down & click save. ;)
 
Last edited:
Upvote 0
Thanks Fluff ! The last formula is returning #Value!.
Additionally, how can I incorporate the value that you have put in cell F2 into the formula rather than having to reference cell F2 as I will have other numbers than 350350?
 
Upvote 0
I got the formula to work for it to return 8 by changing to B2:B39 to C2:C39 and had to hit Crtl+Shift+Enter.

So regarding the reference cell F2, I can just change it to 350350 and it works fine.

Thanks very much.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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