Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use multiple isblank statements inside an if statement

Is it possible to use multiple isblank statments in an if statement. I want to use something like this sudocode

=if(isblank(g8)&isblank(h8), "both blank", "not both blank")
=if(isblank(g8&h8), "both blank", "not both blank")

These function return the $VALUE error or return the wrong text int the if statement.

Is there a way to do this?

like image 732
Jonny Avatar asked Nov 08 '12 23:11

Jonny


People also ask

How do I combine if and Isblank in Excel?

Sometimes you need to check if a cell is blank, generally because you might not want a formula to display a result without input. In this case we're using IF with the ISBLANK function: =IF(ISBLANK(D2),"Blank","Not Blank")

Can IF statement have 2 conditions in Excel?

The IF function allows you to make a logical comparison between a value and what you expect by testing for a condition and returning a result if True or False. So an IF statement can have two results. The first result is if your comparison is True, the second if your comparison is False.

How do you write an IF THEN formula in Excel with multiple criteria?

Another way to get an Excel IF to test multiple conditions is by using an array formula. To complete an array formula correctly, press the Ctrl + Shift + Enter keys together. In Excel 365 and Excel 2021, this also works as a regular formula due to support for dynamic arrays.


2 Answers

=if(AND(isblank(g8),isblank(h8)), "both blank", "not both blank")
like image 183
Tim Williams Avatar answered Oct 22 '22 02:10

Tim Williams


If your ranges are contiguous, using the following formula will take as many arguments as you want, with a much easier syntax to type when you expand the range:

=if(counta(g8:h8)=0, "both blank", "not both blank")

like image 2
nutsch Avatar answered Oct 22 '22 03:10

nutsch