When I'm working on website migrations or large numbers of redirects. I tend to do them in batches as it can often be easier to manage in batches or page types (CMS, Blog, PLP, Products, etc). Also, if you're looking over legacy redirect files, you could class that as a batch too.
The point I'm getting to is that with large batches of redirects when you amalgamate them into a single list of URLs. You will likely encounter that origin (aka source) URLs may point at multiple destination URLs. Removing duplicate rows will not pick these up. You need a formula for that. This Google Sheets (and Excel) formula identifies the origin URLs that are pointing to multiple destinations.
This formula works by:
The point I'm getting to is that with large batches of redirects when you amalgamate them into a single list of URLs. You will likely encounter that origin (aka source) URLs may point at multiple destination URLs. Removing duplicate rows will not pick these up. You need a formula for that. This Google Sheets (and Excel) formula identifies the origin URLs that are pointing to multiple destinations.
Code:
=IF(COUNTIFS(A:A, A2, C:C, "<>"&C2) > 0, "Multiple Destinations", "Single Destination")
This formula works by:
- Using COUNTIFS to count how many times the URL in the current row of Column A appears with a different destination URL in Column C.
- If the count is greater than 0, it means there is at least one other destination for the same origin, indicating multiple destinations.
- It will display "Multiple Destinations" if there are multiple destinations for the same origin URL, and "Single Destination" if there's only one.
- Set a filter to the multiple destinations and start cleaning up the straggler redirects.