Google Answers Logo
View Question
 
Q: Excel Puzzle ( No Answer,   3 Comments )
Question  
Subject: Excel Puzzle
Category: Computers > Algorithms
Asked by: burnt_toast-ga
List Price: $5.00
Posted: 08 Aug 2004 23:51 PDT
Expires: 09 Aug 2004 18:28 PDT
Question ID: 385307
This is what Sheet1 of my Excel Workbook looks like:

   A         B         C         D         E
1  POSITION  HIRING                        BENEFITS
2  Cashier   Open                          Yes
3  Cashier   Open                          No
4  Cashier   Closed                        Yes
5  Cashier   Closed                        No
6  Manager   Open                          Yes
7  Manager   Open                          No
8  Manager   Open                          Yes
9  Manager   Closed                        No


This is what Sheet2 of my Excel Workbook looks like:

   A         B
1  POSITION  HIRING OPEN AND BENEFITS YES
2  Cashier   1
3  Manager   2


What is the formula necessary to calculate cells B2 and B3 on Sheet2?
I do not want to have to rearrange my rows or columns or alter my
sheets in any way, other than entering formulas in cells B2 and B3 of
Sheet2.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Excel Puzzle
From: joey-ga on 09 Aug 2004 00:55 PDT
 
I can't figure out a way to do it, and I went so far as to play around
with array formulas.

The easiest way I could come up with to do it is to add an F column that has:
     =CONCATENATE(A2,B2,E2).
Then, in Sheet 2, to do:
B2   =COUNTIF(F:F,"CashierOpenYes")
C2   =COUNTIF(F:F,"ManagerOpenYes")

Otherwise, maybe a macro would work.  But Excel is pretty limited in
its abilities to create loops in formulas to iterate through the three
IF statements per line.
Subject: Re: Excel Puzzle
From: furrycushion-ga on 09 Aug 2004 08:03 PDT
 
Hi, 
Put this in cell b2 on sheet2:
=SUM(IF(Sheet1!A2:A9=a2,1,0)*IF(Sheet1!B2:B9="Open",1,0)*IF(Sheet1!E2:E9="Yes",1,0))
then INSTEAD of pressing enter press CTRL+SHIFT+ENTER.
And for cell b3, put this:
=SUM(IF(Sheet1!A2:A9=a3,1,0)*IF(Sheet1!B2:B9="Open",1,0)*IF(Sheet1!E2:E9="Yes",1,0))
again, INSTEAD of pressing enter press CTRL+SHIFT+ENTER.

if you do it correct and press ctrl+shift+enter, you will see
{=SUM(IF(Sheet1!A2:A9=a3,1,0)*IF(Sheet1!B2:B9="Open",1,0)*IF(Sheet1!E2:E9="Yes",1,0))}
in the formula bar
if you do it wrong, then it will show the wrong value
Subject: Re: Excel Puzzle
From: burnt_toast-ga on 09 Aug 2004 18:28 PDT
 
Thanks furrycushion! It works and it's perfect! But you're not a ga
researcher and can't claim the prize huh?

Sorry joey, needed an answer that did not require adding additional
rows and columns.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy