Conditional Statement Producing an Incorrect Value

VUProf

New Member
Joined
Jun 11, 2019
Messages
9
I'm no Excel expert -- so forgive me if I use the incorrect terminology.

In a report I've created using Excel, there is a cell that is to produce a conditional value. The formula I've written for the cell is as follows:

=IF(CalcSheet!F58>1,"low agr",IF(CalcSheet!F58>=0.6,"mod agr","high agr"))

The cell from which the value is created (CalcSheet!F58) has a formula in it that replaces errors with an empty cell. The formula is as follows:
=IFERROR((RaterGroups!AD10),"")

The cell that produces the values of "low agr", "mod agr", or "high agr" is producing a value of "low agr" when CalcSheet!F58 is an empty cell. I don't want it to do that. Ideally, I want it to produce an empty cell itself. Alternatively (though a bit less desirable) would be for the cell to produce an error message -- but "low agr" is NOT appropriate.

Any suggestions on how to add to my conditional statement such that it will produce an empty cell when the cell value it is drawing upon is an empty cell? Thanks so much!

Daniel
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,523
Office Version
  1. 365
Platform
  1. Windows
Hi & wlecome to MrExcel
How about
=IF(Calcsheet!F58="","",IF(Calcsheet!F58>1,"low agr",IF(Calcsheet!F58>=0.6,"mod agr","high agr")))
 
Last edited:

VUProf

New Member
Joined
Jun 11, 2019
Messages
9
Hi & wlecome to MrExcel
How about
=IF(Calcsheet!F58="","",IF(Calcsheet!F58>1,"low agr",IF(Calcsheet!F58>=0.6,"mod agr","high agr")))

That did the trick! I wasn't aware of the "," thing -- is that how you create an empty cell from an "empty cell" that is actually the removal of an error term?
 

DSCfromCFA

Board Regular
Joined
Feb 27, 2018
Messages
147
Office Version
  1. 365
Platform
  1. Windows
G'day VUP,

You seem to have slightly misunderstood the components of the formula - whilst "," can be a way to add a text comma, that is not what is being done in the formula Fluff provided.

If you look carefully you will note that the formula is actually ...="","",IF... which is saying: if F58 is blank (i.e. =""), then blank the cell containing the formula (the second set of double quotes after the comma) otherwise go through the filter process to display the correct message.

Cheers

shane
 
Last edited:

VUProf

New Member
Joined
Jun 11, 2019
Messages
9

ADVERTISEMENT

G'day VUP,

You seem to have slightly misunderstood the components of the formula - whilst "," can be a way to add a text comma, that is not what is being done in the formula Fluff provided.

If you look carefully you will note that the formula is actually ...="","",IF... which is saying: if F58 is blank (i.e. =""), then blank the cell containing the formula (the second set of double quotes after the comma) otherwise go through the filter process to display the correct message.

Cheers

shane


Got it! Thank you for the explanation.
 

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
14,046
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
if F58 is blank (i.e. =""),
Just to point out that the above statement is incorrect. "" is an empty string not a blank, doing the test as Fluff has written it will return an empty string for both an empty string and a blank cell but the original formula would have returned "high agr" and not "low agr" if the cell was actually a blank cell (it was seeing the empty string as text).
 

DSCfromCFA

Board Regular
Joined
Feb 27, 2018
Messages
147
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

You're welcome,

Excel is full of nuances and subtleties that make it the incredibly versatile application that it is.

Cheers
 

DSCfromCFA

Board Regular
Joined
Feb 27, 2018
Messages
147
Office Version
  1. 365
Platform
  1. Windows
Thanks for the correction Mark, I probably knew that once, but lost it in the clutter.
 

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
14,046
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
  2. Mobile
Thanks for the correction Mark, I probably knew that once, but lost it in the clutter.

You're welcome, it is an important difference if you ever use Specialcells - blanks (either manually or via VBA) as it only recognizes genuine blank cells.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,467
Messages
5,636,462
Members
416,919
Latest member
twc2c

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
Top