Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Formula Help - Probably involves IF() and AND()

Posted on 2013-02-06
4
Medium Priority
?
186 Views
Last Modified: 2013-02-11
Hello Experts,

I am currently working on a workbook, which relies on the user inputting values in order to get the answer.

Please view screenshot - Formula
I've spent the majory of the past few nights working on formulas, but this one. has stumped me completely.

Cell I7, returns an answer.  But I don't want that cell to show anything, until certain things are true.

I know how to make a cell appear empty, but this will rely on IF() and AND(), and I've tried to do it myself - but no luck.

Ok....

If the object is set to "Square / Rectangle" (cell B7), and the count of range B7:G7 = 6 (meaning all those cells have values), then yes return the answer in cell I7.

Here where it gets complicated...

If the object is set to "Cylinder" then cell B7, C7 OR D7, E7:G7, and the count of that range = 5, then yes the value in I7 needs to be visible.

Thank you in advance for your help!

~ Geekamo
0
Comment
Question by:Geekamo
  • 2
4 Comments
 
LVL 26

Accepted Solution

by:
redmondb earned 2000 total points
ID: 38858980
Hi, geekamo,

I wasn't sure exactly what you meant by " then cell B7, C7 OR D7, E7:G7, and the count of that range = 5". The following just checks that B7:G7 has exactly 5 non-blank cells...
=IF(OR(AND(B7="Square / Rectangle",COUNTIF(B7:G7,"<>")=6),AND(B7="Cylinder",COUNTIF(B7:G7,"<>")=5)),I7,"")

Edit: BTW, it would be marginally more efficient to check the range C7:G7 and reduce the numbers by one, but I assumed that the full range would be clearer for you.

Regards,
Brian.
0
 
LVL 8

Expert Comment

by:5teveo
ID: 38859029
My take is something like this...

=IF(OR(AND(B4="Square",COUNTA(B4:G4)=6),AND(B4="Cylinder",COUNTA(B4:G4)=5,COUNTA(C4:D4)=1)),1,0)

The cylinder range must have 5 items and if C or D is space then you got everything you need in all columns.
0
 
LVL 1

Author Comment

by:Geekamo
ID: 38866822
@ All,

Sorry for the delay in getting back to my post.  I will be back over the weekend.  Thank you in advance for your patience!

~ Geekamo
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38878366
Thanks, Geekamo.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question