ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Using "*" and "#" in If statements (https://www.excelbanter.com/excel-worksheet-functions/213862-using-%2A-if-statements.html)

Eric

Using "*" and "#" in If statements
 
I am trying to write an if statement to return a TRUE for any cell with a
string of text starting with "B". Was thinking something like
if(B2="B"&***,B2,"") but I don't know the proper syntax for the B***.

Any thoughts are appreciated.

Thanks

Dave Peterson

Using "*" and "#" in If statements
 
=if(left(b2,1)="b","starts with B","doesn't start with B")
or
=if(countif(b2,"B*")0,"starts with b","doesn't start with b")

Eric wrote:

I am trying to write an if statement to return a TRUE for any cell with a
string of text starting with "B". Was thinking something like
if(B2="B"&***,B2,"") but I don't know the proper syntax for the B***.

Any thoughts are appreciated.

Thanks


--

Dave Peterson

Niek Otten

Using "*" and "#" in If statements
 
=LEFT(B2,1)="B"

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


"Eric" wrote in message
...
I am trying to write an if statement to return a TRUE for any cell with a
string of text starting with "B". Was thinking something like
if(B2="B"&***,B2,"") but I don't know the proper syntax for the B***.

Any thoughts are appreciated.

Thanks




All times are GMT +1. The time now is 10:26 PM.

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