最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

google sheets - How can I create a simple duplicate detector? - Stack Overflow

programmeradmin2浏览0评论

What I am trying to do is to check for duplicates within my column H (consist of URLs) and column J (consist of URLs). I am using conditional formatting but somehow it only works if I added a duplicate URL within my column H but if I added a duplicate URL from my column J it is not working. here's the formula and range I use:

Apply to range: H1:J1391

Custom formula:

=OR(COUNTIF(H:H, H1)>1, COUNTIF(J:J, H1)>1)

For context: Column J - imported URLs from different google sheet ( formula used: =importrange), the column I imported are constantly getting updated Column H - consist of URls as well, this is where I add URls and where I want to check for duplication within the column and against column J.

This is for work btw, what I do is add URLs in my column H and these URLs are getting added to a different google sheet (where I imported my URLs from column H). I just want to make my life easier that's why I want to create this duplicate detector.

I expect that when I add a duplicate URL from column J to column H it will highlight but somehow my formula only works if I add a duplicate URL from column H.

What I am trying to do is to check for duplicates within my column H (consist of URLs) and column J (consist of URLs). I am using conditional formatting but somehow it only works if I added a duplicate URL within my column H but if I added a duplicate URL from my column J it is not working. here's the formula and range I use:

Apply to range: H1:J1391

Custom formula:

=OR(COUNTIF(H:H, H1)>1, COUNTIF(J:J, H1)>1)

For context: Column J - imported URLs from different google sheet ( formula used: =importrange), the column I imported are constantly getting updated Column H - consist of URls as well, this is where I add URls and where I want to check for duplication within the column and against column J.

This is for work btw, what I do is add URLs in my column H and these URLs are getting added to a different google sheet (where I imported my URLs from column H). I just want to make my life easier that's why I want to create this duplicate detector.

I expect that when I add a duplicate URL from column J to column H it will highlight but somehow my formula only works if I add a duplicate URL from column H.

Share Improve this question edited Jan 20 at 12:46 DarkBee 15.7k8 gold badges70 silver badges114 bronze badges asked Jan 20 at 12:04 LuisseLuisse 31 silver badge1 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 1

You almost got it. How about adjusting the last condition of Countif to >0 instead of >1

Try this Google Sheets formula:

=OR(COUNTIF(H$1:H, H1)>1, COUNTIF(J$1:J, H1)>0)

I have used the absolute reference for each range and adjusted the condition. This formula checks if the value appears in both column H and column J. If yes, it will set the value to TRUE.

Reference:

  • COUNTIF()
发布评论

评论列表(0)

  1. 暂无评论