Solved Choose Returns an Error

January 10, 2013 at 06:06:15
Specs: Windows 7

HI

If the cell I am checking is blank it returns an error #VALUE!

How do I add ISERROR to the following so I dont get an error message

"=CHOOSE((H10),$I$2,$J$2,$K$2,$L$2,$M$2,"")
Many Thanks


See More: Choose Returns an Error

Report •


#1
January 10, 2013 at 06:45:46
✔ Best Answer

emory,

The answer I supplied in an earlier thread also applies to this issue, but with a slight modification.

http://www.computing.net/answers/of...

Do not take this the wrong way, but when you find something that works for you in a help forum, it would behoove you to review the solution in detail so that you understand how it works. Once you have a deeper understanding of the solution, you can use/modify the concept in other situations.

In the previous case, you wanted to return a value if a cell was not equal to 0, so you used the IF function to check for a 0:

=IF(O3<>0,... etc.

In this case, you want the CHOOSE function to return a value if H10 is not empty, so the first thing you would do is check H10 to make sure it is not empty. The CHOOSE function then becomes the value_if_true argument for the IF function.

=IF(H10<>"",CHOOSE(H10,$I$2,$J$2,$K$2,$L$2,$M$2,""),"")

In this case the IF will return "" (nothing) if H10 is empty, but you could have it return whatever you want:

=IF(H10<>"",CHOOSE(H10,$I$2,$J$2,$K$2,$L$2,$M$2,""),"Please enter a value in H10")

2 additional notes:

1 - I'm not sure why you have "" as the last value for the CHOOSE function. If that was your attempt to deal with H10 = "", as you can see that won't work. Your CHOOSE function will return "" if H10 = 6 since that is the 6th argument in your list.

2 - You will note that I removed the parenthesis around H10 in the CHOOSE function. The first argument in the CHOOSE function is the index_num and there is no need to enclose it in parenthesis.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
January 10, 2013 at 07:01:46

Many thanks

I have taken on board what you are saying thank you, the good news is that my boss is sending on an advance excel course so hopefully I will be able to contribute better to your site. I can assure I only ask a question as a last resort as if I can crack it myself I get a better understanding. Each day people ask more and more from the database I am working on so its get more and more complicated and I need to discover different methods of achieving results.


Report •

Related Solutions


Ask Question