Trimmean function

jsical

New Member
Joined
May 22, 2020
Messages
14
Office Version
  1. 365
Platform
  1. Windows
I have the following Data: Amount |Date | Spread for a large set of data. I know how to use TRIMMEAN but i am not sure how to incorporate multiple conditions. i.e I would like to use trimmean to looked at Amounts >=100 &<=500, and Dates >= 01/01/2021 &<=12/31/21, and return the mean Spread base on the data that falls between the 2 criteria of Amount and Date. i am not sure what the syntax would look like. I can do this for an specific set of data but not for in between two sets of data =TRIMMEAN(IF((Amount=50)*(date =12/01/31),Spread),10%) . any help would be greatly appreciated.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Welcome to MrExcel:)

It is not a function that I'm familair with, but it should work the same as any other with additional criteria, see if this format works for what you need.

=TRIMMEAN(IF((Amount>=100)*(Amount<=500)*(date >=start date)*(date <=end date),Spread),10%)
 
Upvote 0
Thank you JasonB75, unfortunately the syntax doesn't work
 
Upvote 0
How did you try entering the formula? I see no reason why it shouldn't work as long as your dates are all in valid formats.
 
Upvote 0
Okay, Formats definitely were an issue. however, the formula still returning #num!.
 
Upvote 0
That should only happen if there are no numeric 'spread' values meeting the criteria.
 
Upvote 0
=TRIMMEAN(IF((Amount>=50)*(Amount<=300)*(Date>=1/1/21)*(Date<=12/31/22),spread),25%) this is the formula and data i using. you can see that there are number that meat the criterias. this is a small portion of the data, i have over 10k lines

AmountDateSpread
75​
9/1/2023​
59​
100​
6/1/2022​
52​
150​
3/1/2022​
9​
75​
2/1/2022​
29​
80​
9/1/2022​
115​
50​
3/1/2021​
31​
125​
11/15/2021​
21​
50​
10/1/2022​
48​
275​
2/1/2023​
22​
50​
7/1/2021​
5​
120​
2/1/2022​
19​
235​
7/15/2022​
40​
250​
8/1/2023​
23​
215​
3/1/2023​
4​
100​
7/1/2021​
38​
65​
7/1/2022​
87​
85​
8/15/2021​
35​
90​
9/1/2022​
60​
180​
12/1/2021​
16​
250​
11/1/2023​
50​
235​
7/1/2022​
67​
75​
9/1/2023​
22​
255​
11/1/2021​
30​
90​
7/1/2021​
50​
100​
9/1/2022​
46​
60​
10/1/2023​
47​
150​
9/1/2022​
8​
50​
8/15/2022​
36​
100​
2/15/2022​
32​
115​
7/1/2021​
36​
70​
7/1/2021​
58​
100​
8/1/2022​
49​
125​
8/15/2022​
27​
275​
7/15/2022​
38​
100​
12/1/2023​
34​
90​
7/1/2021​
45​
300​
10/15/2021​
27​
50​
11/15/2021​
53​
150​
7/1/2023​
41​
200​
8/15/2023​
41​
90​
10/1/2023​
22​
50​
10/1/2022​
48​
50​
10/1/2023​
41​
50​
2/1/2022​
44​
50​
10/1/2021​
29​
 
Upvote 0
This is what I get with your sample and the same formula. Are you entering the dates in the same way?
Book1
ABCDE
1AmountDateSpread
27509/01/2359
310006/01/225201/01/21
415003/01/22912/31/22
57502/01/222938.44
68009/01/22115
75003/01/2131
812511/15/2121
95010/01/2248
1027502/01/2322
115007/01/215
1212002/01/2219
1323507/15/2240
1425008/01/2323
1521503/01/234
1610007/01/2138
176507/01/2287
188508/15/2135
199009/01/2260
2018012/01/2116
2125011/01/2350
2223507/01/2267
237509/01/2322
2425511/01/2130
259007/01/2150
2610009/01/2246
276010/01/2347
2815009/01/228
295008/15/2236
3010002/15/2232
3111507/01/2136
327007/01/2158
3310008/01/2249
3412508/15/2227
3527507/15/2238
3610012/01/2334
379007/01/2145
3830010/15/2127
395011/15/2153
4015007/01/2341
4120008/15/2341
429010/01/2322
435010/01/2248
445010/01/2341
455002/01/2244
465010/01/2129
Sheet4
Cell Formulas
RangeFormula
E5E5=TRIMMEAN(IF((A2:A46>=50)*(A2:A46<=300)*(B2:B46>=E3)*(B2:B46<=E4),C2:C46),25%)
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0
it might be cause i am not doing (Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces. ) let me try that
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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