# I want to run a search and write to Excel if no value is found in the results

**URL:** <https://forum.uipath.com/t/excel/3001413>\
**Category:** フォーラム\
**Created:** [July 18, 2025, 8:41am UTC](https://forum.uipath.com/t/excel/3001413 "2025-07-18T08:41:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![afna](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/afna/32/512761_2.png) [@afna](https://forum.uipath.com/u/afna)\
**Post date:** [July 18, 2025, 8:41am UTC](https://forum.uipath.com/t/excel/3001413/1 "2025-07-18T08:41:19Z")

</div>

I would like to achieve the following:  
How should I configure this?

1. Search for a value retrieved from Excel.
2. If the search results don’t contain an exact match for the value, write that value to Excel.  
If there is an exact match, click the checkbox to select it.  
If there are multiple matches for the value, write that value to Excel.

I tried using Try Catch and similar approaches, but since it searches for the value one result at a time, it takes a long time, and it doesn’t seem to be finding the matches correctly.  
Also, I’m unable to write the value to Excel.

I apologize for the trouble, and I would greatly appreciate your help.

---

<div class="post-metadata">

**Author:** ![yedukondaluaregala](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yedukondaluaregala/32/557780_2.png) [@yedukondaluaregala](https://forum.uipath.com/u/yedukondaluaregala)\
**Post date:** [July 18, 2025, 9:19am UTC](https://forum.uipath.com/t/excel/3001413/2 "2025-07-18T09:19:24Z")

</div>

@afna

Can you give more details,  
like where you are searching some screenshot like that

---

<div class="post-metadata">

**Author:** ![gorby](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/gorby/32/543563_2.png) [@gorby](https://forum.uipath.com/u/gorby)\
**Post date:** [July 18, 2025, 9:35am UTC](https://forum.uipath.com/t/excel/3001413/3 "2025-07-18T09:35:01Z")

</div>

> If there are multiple matches for the searched value,

I can’t quite picture what you mean. Could you attach a screenshot?

---

<div class="post-metadata">

**Author:** ![prashant1603765](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/prashant1603765/32/523412_2.png) [@prashant1603765](https://forum.uipath.com/u/prashant1603765)\
**Post date:** [July 18, 2025, 9:50am UTC](https://forum.uipath.com/t/excel/3001413/5 "2025-07-18T09:50:07Z")

</div>

Hi @afna

Load the Excel data using Read Range. Loop through each value with For Each Row in Data Table. Retrieve the search results with Find Children, then check for a match using Get Text or Get Attribute. If there are no matches, write to Excel using Append Range. If there is one match, click the checkbox using Click. If there are multiple matches, write all of them to Excel using Append Range. Use If for conditional branching; do not use Try Catch.  
Language generated by an LLM.

Happy Automation
