Question

I am new to Excel and am having trouble figuring out the correct formula for doing the following:

I have different variables: A, B, C, D, and E. I ran different experiments and each time, ran the experiment for each variable and recorded the speed. For example, the data looks sort of like this:

╔═══════════════╦═══╦═══╗
║ Experiment 1  ║ A ║ 5 ║
║ Experiment 1  ║ B ║ 3 ║
║ Experiment 1  ║ C ║ 6 ║
║ Experiment 1  ║ D ║ 2 ║
║ Experiment 1  ║ E ║ 4 ║
║ ------------- ║ - ║ - ║
║ Experiment 2  ║ A ║ 6 ║
║ Experiment 2  ║ B ║ 5 ║
║ Experiment 2  ║ C ║ 6 ║
║ Experiment 2  ║ D ║ 2 ║
║ Experiment 2  ║ E ║ 2 ║
╚═══════════════╩═══╩═══╝

I want to be able to count, for the entire spreadsheet, how many times each method produces the lowest output. For example, for the above data, I would get:

╔═══╦═══╗
║ A ║ 0 ║
║ B ║ 0 ║
║ C ║ 0 ║
║ D ║ 2 ║ 
║ E ║ 1 ║
╚═══╩═══╝

where ties are counted for each method (aka D and E are both counted for Experiment 2).

I have absolutely no idea how to do this. I tried something like:

=COUNTIF(A2:C8, MIN(A2:C8)==CELL("content",B2))

which obviously does not work.

Also, I currently have the spreadsheet in Google Drive, but tagged Excel because I am under the impression that the two have similar formulas. If this is something that is only possible in Excel, I can switch to that program instead.

Was it helpful?

Solution

In excel you can calculate that without a helper column if you use this formula

=SUMPRODUCT((COUNTIFS(A$2:A$11,A$2:A$11,C$2:C$11,"<"&C$2:C$11)=0)*(B$2:B$11=E2))

where your data is in A2:C11 and you have a specific variable in E2 like this:

enter image description here

see sample workbook

OTHER TIPS

The QUERY function provides a method in Google Sheets for providing the entire table:

=ArrayFormula(QUERY(IF({1,0},B2:B11,N(C2:C11=MIN(C2:C11))),"select Col1, sum(Col2) group by Col1 label sum(Col2) ''",0))

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top