ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Simple Find Text problem (https://www.excelbanter.com/excel-programming/349420-simple-find-text-problem.html)

sammy

Simple Find Text problem
 
How do I simply find text in a string within a cell and if true add the value
from another string and if false simply keep the current value for a running
total. When I enter the formula

IF(FIND(B15,"FEE"),E14,E14+C15)

It returns the #VALUE! error.

In this example I am placing this in cell E15 to create a running total of
all fees charged.

How do I format the formula to get an IF THEN ELSE type solution?


Leith Ross[_456_]

Simple Find Text problem
 

Hello Sammy

The Find function returns a #Value! error if the string you ar
searching for is not found. To make your code work, you need to tes
for the error. Did you mean to search for the value of B15 in "FEE" o
vice versa. I assumed the opposite.

*Revised Formula:
= IF(ISERROR(FIND("Fee", B15))=FALSE, E14, E14+C15

Sincerely
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=49770


Dave Peterson

Simple Find Text problem
 
A couple of ways:

=E14+ISNUMBER(SEARCH("fee",B15))*C15
or
=E14+IF(ISNUMBER(SEARCH("fee",B15)),C15,0)

Sammy wrote:

How do I simply find text in a string within a cell and if true add the value
from another string and if false simply keep the current value for a running
total. When I enter the formula

IF(FIND(B15,"FEE"),E14,E14+C15)

It returns the #VALUE! error.

In this example I am placing this in cell E15 to create a running total of
all fees charged.

How do I format the formula to get an IF THEN ELSE type solution?


--

Dave Peterson


All times are GMT +1. The time now is 11:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com