IF formula

danielryle

New Member
Joined
Mar 2, 2022
Messages
9
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi all,

Relative beginner here, sorry!

I currently have a formula that is producing the result I need,

'=IF(E10>=30,"3",IF(E10>=23,"2",IF(E10<23,"1", "")))'

1646239957227.png


However if the cell contains text or is blank as shown above, I would like the resulting cell to be empty. How do I change my current formula to achieve this.

Many thanks,

Dan
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(or(e10="",istext(e10)),"",if(E10>=30,"3",IF(E10>=23,"2",IF(E10<23,"1", ""))))
 
Upvote 0
Hi,

A couple more ways, and I'm thinking you may not want quotes in your results, the quotes turns the results (3, 2, 1) into text:

Book3.xlsx
EFG
103533
112522
122011
13a  
14b  
15  
16d  
173033
18e  
Sheet1026
Cell Formulas
RangeFormula
F10:F18F10=IF(COUNT(E10),IF(E10>=30,3,IF(E10>=23,2,1)),"")
G10:G18G10=IF(ISNUMBER(E10),IF(E10>=30,3,IF(E10>=23,2,1)),"")
 
Upvote 0
Solution
Hi,

A couple more ways, and I'm thinking you may not want quotes in your results, the quotes turns the results (3, 2, 1) into text:

Book3.xlsx
EFG
103533
112522
122011
13a  
14b  
15  
16d  
173033
18e  
Sheet1026
Cell Formulas
RangeFormula
F10:F18F10=IF(COUNT(E10),IF(E10>=30,3,IF(E10>=23,2,1)),"")
G10:G18G10=IF(ISNUMBER(E10),IF(E10>=30,3,IF(E10>=23,2,1)),"")
You solved the issue I was just about to come back with!
 
Upvote 0
You solved the issue I was just about to come back with!

Good to know, thanks for the feedback.

One more way, in case you're interested:

Book3.xlsx
EFGH
1035333
1125222
1220111
13a   
14b   
15   
16d   
1730333
18e   
Sheet1026
Cell Formulas
RangeFormula
F10:F18F10=IF(COUNT(E10),IF(E10>=30,3,IF(E10>=23,2,1)),"")
G10:G18G10=IF(ISNUMBER(E10),IF(E10>=30,3,IF(E10>=23,2,1)),"")
H10:H18H10=IF(N(E10),IF(E10>=30,3,IF(E10>=23,2,1)),"")
 
Upvote 0
Good to know, thanks for the feedback.

One more way, in case you're interested:

Book3.xlsx
EFGH
1035333
1125222
1220111
13a   
14b   
15   
16d   
1730333
18e   
Sheet1026
Cell Formulas
RangeFormula
F10:F18F10=IF(COUNT(E10),IF(E10>=30,3,IF(E10>=23,2,1)),"")
G10:G18G10=IF(ISNUMBER(E10),IF(E10>=30,3,IF(E10>=23,2,1)),"")
H10:H18H10=IF(N(E10),IF(E10>=30,3,IF(E10>=23,2,1)),"")
New question: How would one write a formula for a cell that would say: If E10='word1' then F10='number1' and if E10='word2' then F10='number2' and similarly I would need to use the numbers in a subsequent calculation so would need to be a number and not text.
 
Upvote 0
If you need the result to be numeric, then you cannot have text in the cell. However you could use a custom cell format to make it look as though the word "number" is there.
 
Upvote 0
There are many ways to do this, from Nested IFs, VLOOKUP, INDEX/MATCH, LOOKUP, etc.
Depending on, for example, How many different words you have, and the values you want returned.

Note: Mods may suggest you open a new thread for your new question.
 
Upvote 0

Forum statistics

Threads
1,215,471
Messages
6,125,000
Members
449,202
Latest member
Pertotal

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