View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
santaviga
 
Posts: n/a
Default HELP!!!! on formula PLEASE!!!!!!!!!!!!

Hi Pete_UK,

Thanks for this it works a treat but cant figure out how to put it into
practise on my cells, I need to take the data from another sheet and put it
onto a summary sheet, can this formula include data from another sheet, also
instead of reference cells can these be replaced by text??

Thanks for your help!!!

Mark

"Pete_UK" wrote:

To model your problem I did the following:

I put the word "Input" in A1, and defined a named range called "Data"
covering A2 to A20 - obviously you might need to extend this range,
depending how much data you have.

I put this test data in A2 to A9:

21F
56M
74F
3M
33F
47M
65F
66F

I put these values in cells F1 to K1:

0, 6, 16, 31, 71, 200, and these headings in F2 to J2:

0-5 6-15 16-30 31-70 71+

I put the word "Male" in E3 and "Female" in E4, and in F3 I entered
this array formula*:

=SUM(IF(Data="",0,IF((RIGHT(Data,1)=LEFT($E3,1))*( VALUE(LEFT(Data,LEN(Data)-1))F$1)*(VALUE(LEFT(Data,LEN(Data)-1))<G$1),1,0)))

* As this is an array formula, once you have typed it in (or
subsequently edit it), you must use CTRL-SHIFT-ENTER rather than just
ENTER. If you do this correctly then Excel will wrap curly braces { }
around the formula - you must not type these yourself.

The formula can then be copied to G3:J3 and to F4:J4. The result is
this table in E2:J4

0-5 6-15 16-30 31-70 71+
Male 1 0 0 2 0
Female 0 0 1 3 1

You should be able to change the references to suit your own
circumstances.

Hope this helps.

Pete