If does contain this text return this value and if does not contain this text return this value

Brandensa14

New Member
Joined
Feb 3, 2025
Messages
1
Office Version
  1. 2021
Platform
  1. Windows
So below I have where I'm at, but can't figure out where to go from here. Right now, this formula is returning a value (equation) when a cell in table "Division" DOES NOT contain the letters "RBLD". I also need it to return a different value (equation) if DOES contain the letters "RBLD". So in words I want the equation to do this: If does contain "RBLD" then return [equation] OR if does not contain "RBLD" then return [different equation]. The equation for the DOES NOT is 10% of a column [@Collected] minus value from another column [@Subs]. The equation for the DOES contain "RBLD" will be 5% of a column [@Division] minus another column [@Subs].
FYI, I have the IFERROR in the beginning so the cell is blank when transferring over from another sheet and different names cause an error.

Let me know if you need additional information. Thank you!

=IFERROR(IF(ISERROR(SEARCH("RBLD",[@Division])),[@Collected]*0.1-[@Subs],""),"")
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Welcome to the Board!

Can you show us a sample of your data, and your expected results for the different scenarios?
A lot of times, visual images go a long way in showing you what you are working with, and what you hope to get out of it.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Welcome to the MrExcel board!

The equation for the DOES contain "RBLD" will be 5% of a column [@Division]
I am assuming that is a typo. Your formula is looking for "RBLD" in [@Division]. If it finds it then [@Division] must be a text column so you cannot get 5% of it. I assume you mean 5% of [@Collected]

I am also unsure of the IFERROR use.

However, try this
Excel Formula:
=[@Collected]*IF(ISNUMBER(SEARCH("RBLD",[@Division])),0.05,0.1)-[@Subs]
 
Upvote 0

Forum statistics

Threads
1,226,463
Messages
6,191,181
Members
453,645
Latest member
BOUCHOUATA

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top