[Excel] Formula Cell with Number and Text

Solved
anixela Posted messages 252 Registration date   Status Membre Last intervention   -  
 maged -
Good evening,

I am reaching out because I have not been able to find an answer to my problem.

Let me explain:
- Column A can contain either a number or text (which is variable)
- Column B contains a number
- Column C (this is where it gets tricky) should contain: if A is a number, the result of A*B, and if A is text, then we put 0.

My problem is that I don’t know how to translate the following phrase into Excel language: "If Ax is a number then do Ax*Bx otherwise put 0".
I know that I need to use the IF function (condition; value if true; value if false).

Can you help me translate the condition?

Thank you for the help you will provide.

Good night to all
Anixela
Configuration: Windows XP Firefox 2.0.0.9

10 réponses

gbinforme Posted messages 14930 Registration date   Status Contributeur Last intervention   4 742
 
Hello

This formula should suit you. We check if A is numeric ISNUMBER(A1) and if so, we multiply, otherwise zero.
=IF(ISNUMBER(A1),B1*A1,0)


always zen
50
jeanchristof Posted messages 1 Status Membre
 
Hello, New to this forum, I'm sorry to revisit this old and excellent response, but it doesn't work every time. In my case, cell A1 is a number coming from a "Alea()" function... the result of my multiplication (B1*A1) is FALSE two out of three times, either PLUS or MINUS. I can't seem to find a solution. Thank you in advance to the experts for your response. JC
0
The Engineer
 
Hello,
I’m returning to this old question.
In my humble opinion, it’s simpler to use the “N” function.
The formula becomes, in column C1:
=N(A1)*B1
…if I’m not mistaken.
0
mary
 
You're welcome :)
0
maged
 
thank you
0