conditional t.test (t.testif)

Avit

Board Regular
Joined
Jan 9, 2013
Messages
85
Platform
  1. MacOS
Hi all,

I am really just trying to do a ttest when a condition is met. So just like averageif, but with a ttest.
I was able to stdevif with an array, and I am pretty sure this will be an array too, but I can't quite get the formula

Example:
column b has male of female, column c has data i want to ttest with column d, but only for male.

Thanks a lot!
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Example:


Excel 2010
BCDE
1GenderValue1Value2
2M39940.4043831
3M9943
4F384
5M6864
6M395
7F5712
8F28100
9M3551
10M5970
11M5896
Sheet1
Cell Formulas
RangeFormula
E2{=TTEST(IF(B2:B11="M",C2:C11),IF(B2:B11="M",D2:D11),1,1)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
It worked, thank you very very much!

I am working on some statistical analysis for an NGO, so I am not sure what else I am going to need, but in case I want to ttest given two conditions (column b=male, column c = age (below 20, above 20 for example) - and ttest for columns d and e.
How would that be done?

Thanks again
 
Upvote 0
Like this?

=TTEST(IF((B2:B11="M")*(C2:C11<20),D2:D11),IF((B2:B11="M")*(C2:C11<20),E2:E11),1,1)

Don't forget to confirm with Ctrl+Shift+Enter.
 
Upvote 0
Thanks again,

I actually haven't checked it yet, but thank you anyway for all your help
 
Upvote 0

Forum statistics

Threads
1,223,406
Messages
6,171,927
Members
452,434
Latest member
NUC_N_FUTS2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top