# Need formula

#### Arunachalam1983

##### New Member
Hi everyone!

If A1 has the text "Cement" then it should calculate and produce result in A5 like this (A2/105*100). A2 will have some numerical value. If A1 does not have Cement then A5 should show 0.

### Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

#### Kingarvind1

##### New Member
Below formula will go in A5

=IF(A1<>"Cement",0,(A2/105*100))

Last edited:

#### Arunachalam1983

##### New Member
It gives 0 as answer, even if A1 has cement.

#### JackDanIce

##### Well-known Member
Try:
Code:
``=(A1="Cement")*(A2/105*100)``

#### Arunachalam1983

##### New Member
Used the formula =(A1="Cement")*(A2/105*100) in A5. It is still the same, answer is 0.

#### JackDanIce

##### Well-known Member
When I put Cement into A1 and 3 into A2, with the suggested formula, I got 2.857143 in A5
When I deleted A1, then I get 0 in A5
I'm using Excel 2016

Try:
Code:
``=--(A1="Cement")*(A2/105*100)``

#### Ryan1996

##### Board Regular
=IF(A1="cement", (A2/105*100),"0") will work as long as you have some data in A2 otherwise it will show 0.

• JackDanIce

#### Arunachalam1983

##### New Member
This works fine. Thanks, Ryan.

#### JackDanIce

##### Well-known Member
Arunachalam, Ryan confirmed my suggested formula works, as long as A2 is not blank and I suggested adding -- to it if what originally suggested didn't work.

What do you have working now and is it because A2 is not blank?

1,102,099
Messages
5,484,656
Members
407,459
Latest member
DICKSON KIMEMIA

### This Week's Hot Topics

• Finding issue in If elseif else with For each Loop
Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
• MsgBox Error
Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
• CELL FORMAT - IF CONDITION
My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
• Show numbers nearly the same
Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...