Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MasterHowl

macrumors 65816
Original poster
Oct 3, 2010
1,067
182
North of England
I'm counting sedimentary clasts tomorrow (don't ask...) and I need a spreadsheet to help me crunch the numbers.

I made little drop down menus yesterday so it's easy to input the clast type.

Screen%20Shot%202013-06-25%20at%2022.14.21.png


However, I need the total number of that type of clast in a different table (so I can ultimately make a pie chart of clast proportions).

Eg, if I see 25 Calcite clasts, I'll have selected "calcite" 25 times from the drop-down menus, and I need "25" to appear in the table in the screen shot below.

I think it's something to do with the SUMIF() function but I can't get it to work properly.

Screen%20Shot%202013-06-25%20at%2022.14.29.png


I hope explained myself properly! Thanks

PS: apologies for the mistake in the thread title!
 
Last edited:
Try the COUNTIF function

Hi

If I understand you correctly, I think what you need is the COUNTIF function.

It takes two parameters. The first is the range that you want to search, which would be the column in your first table containing the selected items. The second parameter is the value that you're looking for. The result of the function is the number of cells within the range that contain that value.

Using your example, if you created a cell in your second table containing the formula =COUNTIF(Table 1 :: $A, "Calcite"), it would return the number of cells in column A of Table 1 that contained the value "Calcite".

Hope this helps!

Mark
 
Last edited:
In numbers and Excel, countif will do this as mentioned. In excel, a simple pivot will achieve the same thing. Put the clast composition in the row column and in the values box and it will give you same thing.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.