Using If statements with text

jpm021990

New Member
Joined
Sep 11, 2014
Messages
11
Hi,

Im trying to check column A for specific text and if it finds it put a value in column 2, i have multiple if statements and they work, the problem is if i apply the function to the whole row, it pasts "false" in column 2 and it ends up freezing excel because it does it thousands of times

is there any way to stop it?

this is my function

=IF(ISNUMBER(SEARCH("BF-O",A:A)),"3",IF(ISNUMBER(SEARCH("BF-W",A:A)),"1.9",IF(ISNUMBER(SEARCH("BF-R",A:A)),"2.4")))


thanks
 
I'm guessing the latter, if you are checking on a row by row basis:
This formula is for XL2007 and higher:
=IFERROR(VLOOKUP(A1,{"BF-O",3;"BF-W",1.9;"BF-R",2.4},2,0),"")
 
Upvote 0

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
=IF(ISNUMBER(SEARCH("BF-O",A:A)),"3",IF(ISNUMBER(SEARCH("BF-W",A:A)),"1.9",IF(ISNUMBER(SEARCH("BF-R",A:A)),"2.4")))

works correctly, it gives me the number i need, but it pastes "false" if the row is empty and since im pasting this to all of column B, its giving me thousands of "falses"
 
Upvote 0
You don't an entire column in the formula.

Put this in B2 and copy down.

=IF(ISNUMBER(SEARCH("BF-O",A2)),"3",IF(ISNUMBER(SEARCH("BF-W",A2)),"1.9",IF(ISNUMBER(SEARCH("BF-R",A2)),"2.4", "")))
 
Upvote 0
Give this a try (put it in B1 and copy down):

=COUNTIF(A1,"*BF-O*")*3+COUNTIF(A1,"*BF-W*")*1.9+COUNTIF(A1,"*BF-R*")*2.4
 
Upvote 0

Forum statistics

Threads
1,215,034
Messages
6,122,782
Members
449,095
Latest member
m_smith_solihull

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