[comp.sys.mac] Help needed with text + Excel

brucec@astroatc.UUCP (06/22/87)

Hi, I am using Excel on the Mac & I am having problems with using 
text instead of numbers. 

I have a list of items & numbers that are either S(mall), M(medium) of L(arge) 
and either N(ew) , O(ld) or blank for not there.

As a sample I would have:

1 S N
2 S O
3 M 
4 S N
5 L N

I would like to be able to calculate the number of OLD: S,M,L and New S,M,L.

I tried to use the function "=IF($B1="S",IF($C1="O",1)) on each line (on
$D, for example) and sumed up all of the 1's in $D but I doubled the
amount of data needed (I had similar functions in the $E, $F, $G columns).

Q: Is there an easy (or hard) way to match up 2 numeric fields and add up 
   the number of matches??????  Do I need to write a macro?

Any leads will be greatly appreciated.
-- 
|{seismo,harvard}!uwvax!astroatc!brucec "A person is only as big as the
|{ihnp4,decvax}!nicmad!astroatc!brucec       things that make him angry."

graifer@net1.ucsd.edu (Dan Graifer) (06/22/87)

There are two easy ways to do what you want to do (count by two criteria). 
A minor modification of your method would be to use a single column of 
D1:IF($B1 = $F$1, IF($C1 = $G$1,1,0),0) 
and use a TABLE(F1,G1) on SUM(D1:D5).  

Or you can avoid the column of ifs by using Excel's database functions. I 
have enclosed a Binhex 4.0 example.

                              Dan Graifer
                              graifer@net1.UCSD.EDU
Disclaimer: Nobody ever listens to me anyways; Why should they start now?
---------------------------<CUT HERE>--------------------------------------
(This file must be converted with BinHex 4.0)

:%89iB@e`E'8JCQpb)%*bG@0P!&K-3NjB3d9-!*!%#P8!N!4dGP-R!"'V*`#3"`)
$*J!B!"B$2J08!!lqZ!!$!!i!X3*eFJS!#K9H'G%$AKRGB@"JAKD3!!"RB*!$Iim
`B@"J%hpX&T!!!(i5MaD&IK"X)T!!!(iGMaD'IKYI!RCkN!!!ILU2&QfXHUeJIf#
3!j!!!(ijN!!!IMf3!!"q3C!!!(j&N!!!INQ2BG8@Khj3Mc%8Gf!@Ifq&&'VA&Rp
ZV(UYIQ53!!"qD*!!!(jXMf(9&R+&IR52ILCcIL*bV(UYIS#2BG8@F)9qL)pq1R&
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ens to me anyways; Why should they start now?