If a cell contains a word than another cell is divided by 10

Copper Contributor

Hello,

 

I am trying to find a way to create a formula that will automatically divide a number contained in a cell by ten.

Example: A1 contains one of a series of text such as Large-bob, Medium-bob, or Small-bob. A2 contains a number such as 50, 60, or 70. Is there a formula I can create for A3 if A1 contains bob or -bob then A2 is divided by ten?

 

The goal is to make a CSV file that pulls data from an xl sheet template. Data will be exported in two columns, one containing part numbers and the other qty, and those columns will be copied and pasted into the template. The part numbers always come in the format of "Large-bob". Some of the parts qty will come in any number but others will always be rounded to the nearest 10. For certain part numbers that have qty's rounded to ten, I need them divided by ten as they are lots of 10. 

 

Is it possible for anyone could help me figure this out? Thanks a lot.

2 Replies

@TAlarie 

=IF(AND(COUNTIF(A1,"*-bob*"),MOD(B1,10)=0),B1/10,B1)

Maybe this formula does what you are looking for. The formula checks if the string in column A contains "-bob" and if the number in column B is a multiple of 10. If true the number in column B is divided by 10 otherwise the number in column B is returned.

divide by 10.png 

Awesome, thank you so much.