# Execute Excel Formula with Powershell

**URL:** <https://forums.powershell.org/t/execute-excel-formula-with-powershell/10885>\
**Category:** PowerShell Help\
**Created:** [June 26, 2018, 7:35pm UTC](https://forums.powershell.org/t/execute-excel-formula-with-powershell/10885 "2018-06-26T19:35:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hdsouza](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hdsouza](https://forums.powershell.org/u/hdsouza)\
**Post date:** [June 26, 2018, 7:35pm UTC](https://forums.powershell.org/t/execute-excel-formula-with-powershell/10885/1 "2018-06-26T19:35:05Z")

</div>

I can execute the following formula in Excel and it gets the last price of IBM  
=RTD(“tos.rtd”, , “LAST”, “IBM”)

How can execute something similar using PowerShell ?

(The above formula was taken from [Quotes from Thinkorswim via TOS.RTD - RealTimeToDB](https://www.stock-data-solutions.com/realtimetodb/rtd-database-quotes-tos-rtd.htm) )

Thanks  
Hil

---

<div class="post-metadata">

**Author:** ![cooperdaniel511](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/cooperdaniel511/32/321_2.png) [@cooperdaniel511](https://forums.powershell.org/u/cooperdaniel511)\
**Post date:** [June 28, 2018, 7:04am UTC](https://forums.powershell.org/t/execute-excel-formula-with-powershell/10885/2 "2018-06-28T07:04:20Z")

</div>

well, I can suggest you that you should follow these things:  
Most of the time in excel to find how many “string” is used in a row we use

=NB.SI(range,“string”).  
I would like to call this function (=NB.SI(range," string") ) with a PowerShell script.

I tried to use$objExcel.worksheetFunction.Match(“string”,range) but it wasn’t useful.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:35pm UTC](https://forums.powershell.org/t/execute-excel-formula-with-powershell/10885/3 "2024-05-16T20:35:49Z")

</div>

Closed on May 16, 2024, 8:35pm UTC


