To create a custom Google Sheets formula that identifies the locations of exact word matches within a given text and copies the text into a row, you can use a combination of built-in functions like `SEARCH`, `FILTER`, `SPLIT`, and `ARRAYFORMULA`. However, for more complex needs, you might consider using Google Apps Script.
Here’s a basic formula approach that you can adapt:
1. Assume your target word is in cell A1, and the text to search in is in cell B1.
2. To identify the location of the exact word matches in the text, you could use:
```excel
=ARRAYFORMULA(IFERROR(FILTER(ROW(SPLIT(B1, " ")), SPLIT(B1, " ") = A1), "Not found"))
```
3. To copy the text based on the location of the matches, the process becomes a bit complex since you want to create a row-wise output for matches. Here’s how you could use a script:
### Google Apps Script Approach
1. Go to Extensions > Apps Script.
2. Replace the code in the script editor with:
```javascript
function findExactMatches(targetWord, text