View Duplicate Rows in Table Return Value "True" (Not true when Filtered)

L

Legacy 183598

Guest
Hello.

I cannot get the photo to link correctly: please refer to the photo as a reference. Thanks!

http://s24.photobucket.com/albums/c47/johnnytoscani/?action=view&current=CountIf.jpg

I wanted to see if the data I entered contained any duplicate information for a specific column ("ID") in a table I created and to return a value of "True" when the row had duplicate data

I used a COUNTIF Function and it worked. However, after doing this, I applied filters to some of the columns and the COUNTIF values that were displayed were no longer valid because they were including the hidden rows/cells. I watched a few of the videos on here and some said to use "SUMPRODUCT" and others said to use "SUBTOTAL." I still am not sure what approach to take.

Using the above photo, let's say I wanted to filter the results only by "Procedure Description." How can I get the "True" to become "False" when filtering is applied?

Thank you in advance for your help!
 
Last edited by a moderator:

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hello.

I cannot get the photo to link correctly: please refer to the photo as a reference. Thanks!

http://s24.photobucket.com/albums/c47/johnnytoscani/?action=view&current=CountIf.jpg

I wanted to see if the data I entered contained any duplicate information for a specific column ("ID") in a table I created and to return a value of "True" when the row had duplicate data

I used a COUNTIF Function and it worked. However, after doing this, I applied filters to some of the columns and the COUNTIF values that were displayed were no longer valid because they were including the hidden rows/cells. I watched a few of the videos on here and some said to use "SUMPRODUCT" and others said to use "SUBTOTAL." I still am not sure what approach to take.

Using the above photo, let's say I wanted to filter the results only by "Procedure Description." How can I get the "True" to become "False" when filtering is applied?

Thank you in advance for your help!
Try this...

Book1
AB
1TRUE_
2__
3RegionID
4East6
5North4
6South1
7South10
8East5
9South7
10South2
11North8
12West8
13East10
14North2
15East4
16South2
17East2
18East1
19North8
20West6
Sheet1

Array formula** entered in A1:

=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(B4,ROW(B4:B20)-ROW(B4),0,1)),MATCH(B4:B20,B4:B20,0)),ROW(B4:B20)-ROW(B4)+1)>1,1))>0

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

Now, if you were to filter column A on East then the formula will return FALSE as there are no duplicates in the filtered rows of column B.
 
Last edited:
Upvote 0
Hi, and thank you for your help! This formula works for the entire worksheet but how can I get it to work at the end of each row like in my photo?

Given your example, let's say I wanted to add your formula at the end of each row starting in cell C4, C5, et al.

EG:
Cell C4 I think would be:
{=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(B4,ROW(B4:B20)-ROW(B4),0,1)),MATCH(B4:B20,B4:B20,0)),ROW(B4:B20)-ROW(B4)+1)>1,1))>0}

What should cell C5 read?
Cell C5:
{=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(B4,ROW(B4:B20)-ROW(B4),0,1)),MATCH(B4:B20,B4:B20,0)),ROW(B4:B20)-ROW(B4)+1)>1,1))>0}

Currently, when I autofill the rest of the rows, the cell references escalate sequentially (and I don't think this is correct) like so:

{=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(B5,ROW(B5:B21)-ROW(B5),0,1)),MATCH(B5:B21,B5:B21,0)),ROW(B5:B21)-ROW(B5)+1)>1,1))>0}

I'm guessing I need to use dollar signs or something to tell it to do this and will this require an array or not?

Thanks again!
 
Upvote 0
Hi, and thank you for your help! This formula works for the entire worksheet but how can I get it to work at the end of each row like in my photo?

Given your example, let's say I wanted to add your formula at the end of each row starting in cell C4, C5, et al.

EG:
Cell C4 I think would be:
{=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(B4,ROW(B4:B20)-ROW(B4),0,1)),MATCH(B4:B20,B4:B20,0)),ROW(B4:B20)-ROW(B4)+1)>1,1))>0}

What should cell C5 read?
Cell C5:
{=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(B4,ROW(B4:B20)-ROW(B4),0,1)),MATCH(B4:B20,B4:B20,0)),ROW(B4:B20)-ROW(B4)+1)>1,1))>0}

Currently, when I autofill the rest of the rows, the cell references escalate sequentially (and I don't think this is correct) like so:

{=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(B5,ROW(B5:B21)-ROW(B5),0,1)),MATCH(B5:B21,B5:B21,0)),ROW(B5:B21)-ROW(B5)+1)>1,1))>0}

I'm guessing I need to use dollar signs or something to tell it to do this and will this require an array or not?

Thanks again!
Maybe this...

Book1
ABC
3RegionIDDupes
4East6TRUE
5North4TRUE
6South1TRUE
7South10TRUE
8East5FALSE
9South7FALSE
10South2TRUE
11North8TRUE
12West8TRUE
13East10TRUE
14North2TRUE
15East4TRUE
16South2TRUE
17East2TRUE
18East1TRUE
19North8TRUE
20West6TRUE
Sheet1

Formula entered in C4 and copied down:

=SUMPRODUCT(SUBTOTAL(3,OFFSET(B$4,ROW(B$4:B$20)-ROW(B$4),0,1)),--(B$4:B$20=B4))>1

If you filter on East this will be the result:

Book1
ABC
3RegionIDDupes
4East6FALSE
8East5FALSE
13East10FALSE
15East4FALSE
17East2FALSE
18East1FALSE
Sheet1

If you filter on North this will be the result:

Book1
ABC
3RegionIDDupes
5North4FALSE
11North8TRUE
14North2FALSE
19North8TRUE
Sheet1
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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