#### andrewmurray86

##### New Member
Hi all,

This is my first post here:

I'm attempting to identify the smallest number within a column. I have a series of sheets with a column that's filled with profit from forex trades.
The formula is here

=MIN(IF(O4:O254<0,MIN(O4:O254),O4:O254))

It is working fine to give the largest loss

I have an overview sheet also which has more data in the columns and I need to exclude some figures from the calculation, they are giving skewed results

=COUNTIFS(F2:F252,"isnumber", N2:N252, MIN(IF(N2:N252<0,MIN(N2:N252),N2:N252)))

Please note that the N/O column difference is only due to the way the information is displayed, the

Essentially I am trying to exclude the any rows from the calculation if the cell in F is blank.

The current formula returns a \$0.00 value but that's not correct.

Any assistance would be wonderful and very appreciated.

### Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

#### kweaver

##### Well-known Member
Welcome to Mr. Excel.

Do you want to count something or just find the smallest in column N without considering blanks in column F?
Does this do what you want?

Code:
``=MIN(IF(F2:F252<>"",N2:N252,""))``

#### andrewmurray86

##### New Member
Hey there,

That formula unfortunately gives the values I'm trying to exclude which is super odd.

#### kweaver

##### Well-known Member
My formula should be selecting the values in column N where the values in column F are NOT blank.

Book7
FGHIJKLMNO
1
2317
3-473
4384
58-9
63
7225
8-22-5
9498
10-5-8
11205
12-2
13-80
14810
15313
16415
17-10
184
1950-10
2069
21188
22299
23-10
Sheet2
Cell Formulas
RangeFormula
O23O23=MIN(IF(F2:F252<>"",N2:N252,""))

#### andrewmurray86

##### New Member

Yes, I can see, I"m confused as to why they are still coming up too. I wonder if I might post something for you?

ABCDEFGHIJKLMNOPQRSTUVWXY
1TicketOpen TimeTypeSizeItemPriceS / LT / PClose TimePrice2CommissionTaxesSwapProfitTrade4000
22213919162020.05.06 00:29:47sell0.03eurnzd-e1.791991.814310.000002020.05.06 00:31:351.79421400-4.031 - eurnzd-e3995.97
32213919122020.05.06 00:29:47sell0.03eurnzd-e1.791991.814311.773632020.05.06 00:31:341.79421400-4.046 - eurnzd-e3991.93Updated when trade is closed
42213924122020.05.06 00:38:04sell0.03eurnzd-e1.792231.814540.000002020.05.06 00:38:311.79424400-3.653 - eurnzd-e3988.28Realized Profit/Loss770536.2Profit/Loss of all closed trades-4.03
52213924112020.05.06 00:38:04sell0.03eurnzd-e1.792231.814541.773862020.05.06 00:38:301.79424400-3.644 - eurnzd-e3984.64Gross profit617.83Total profit of all won trades-8.06
62213924182020.05.06 00:38:46sell0.03gbpjpy-e132.515133.8470.0002020.05.06 00:39:37132.666400-4.251 - gbpjpy-e3980.39Gross loss789.27Total loss of all lost trades-12.1
72213924172020.05.06 00:38:46sell0.03gbpjpy-e132.515133.847131.4792020.05.06 00:39:36132.666400-4.262 - gbpjpy-e3976.13Expected payoff-2.06554Average trade outcome-15.75
82216104502020.05.11 23:13:38buy0.05audjpy-e69.86169.00770.7152020.05.13 19:18:0969.007400-39.921 - audjpy-e3936.21Profit factor0.782787Gross profit / gross loss-19.39
142220254812020.05.15 23:31:25sell0.03gbpjpy-e129.765131.203128.3912020.05.18 18:23:07131.203400-40.393 - gbpjpy-e3798Average profit trade\$19.93-108.05
152220254822020.05.15 23:31:26sell0.03gbpjpy-e129.765131.2030.0002020.05.18 18:23:07131.203400-40.394 - gbpjpy-e3757.61Average loss trade-\$15.18-136.82
162220255382020.05.15 23:40:17sell0.05nzdchf-e0.576280.584110.569152020.05.18 16:41:360.58412400-40.641 - nzdchf-e3716.97Long trades30-165.64
172220255392020.05.15 23:40:18sell0.05nzdchf-e0.576280.584110.000002020.05.18 16:41:360.58412400-40.642 - nzdchf-e3676.33Short trades22-206.03
202221284802020.05.19 23:46:27buy0.03audjpy-e70.37868.9360.0002020.05.21 23:33:5270.6154006.573 - audjpy-e3681.66Max. consecutive wins6Longest winning streak (number of trades)-327.7
212221284792020.05.19 23:46:27buy0.03audjpy-e70.37768.93671.3402020.05.21 23:33:5170.6154006.614 - audjpy-e3688.27Max. consecutive losses1Longest losing streak (number of trades)-328.62
242221284912020.05.19 23:49:08buy0.03eurusd-e1.092501.080281.100652020.05.21 15:25:301.1006540024.451 - eurusd-e3812.48Paid commissions220-315.76
262221503252020.05.20 00:01:34balanceFinancing04-0.48 3812.3Win Rate37.35%-216
312221985372020.05.21 00:01:48balanceFinancing4-2.68 4007.91-72.27
362222375342020.05.22 00:01:27balanceFinancing0-0.46 4053.3126.94
372222769442020.05.23 00:01:31balanceFinancing0-0.24 4053.0727.22
382223258612020.05.26 00:01:34balanceFinancing0-0.37 4052.749.74
392223760162020.05.27 00:01:31balanceFinancing0-0.25 4052.4549.28
422224250192020.05.28 00:01:51balanceFinancing0-0.63 3982.0948.42
452224519572020.05.28 23:32:39sell0.04usdchf-e0.964140.973330.958332020.06.01 05:53:210.9601040016.841 - usdchf-e4032.77-21.94
462224519582020.05.28 23:32:40sell0.04usdchf-e0.964140.973330.000002020.06.01 05:53:220.9601040016.832 - usdchf-e4049.6-5.02
472224739622020.05.29 00:02:04balanceFinancing0-0.92 4048.6811.9
482225254872020.05.30 00:01:40balanceFinancing0-0.37 4048.3128.74
512225786202020.06.02 00:01:32balanceFinancing0-0.17 3928.1444.28
562226095132020.06.02 23:50:46sell0.02euraud-e1.619271.644930.000002020.06.04 23:39:091.63130400-16.81 - euraud-e3960.17-52.87
572226095122020.06.02 23:50:46sell0.02euraud-e1.619271.644931.602732020.06.04 23:39:081.63138400-16.912 - euraud-e3943.26-51.99
582226095152020.06.02 23:51:16sell0.02eurnzd-e1.753681.745070.000002020.06.10 01:29:001.7450740011.145 - eurnzd-e3954.4-27.06
592226095142020.06.02 23:51:16sell0.02eurnzd-e1.753681.781261.736062020.06.05 15:32:141.7360640022.826 - eurnzd-e3977.22-43.86
642226313542020.06.03 00:01:53balanceFinancing0-0.57 4039.76-3.41
672226821092020.06.04 00:01:42balanceFinancing04-1.65 4059.735.73
682227332392020.06.05 00:01:57balanceFinancing0-0.58 4059.1256.95
692227769002020.06.06 00:01:59balanceFinancing0-0.25 4058.8757.32
702228226272020.06.09 00:01:59balanceFinancing0-0.26 4058.6155.67
732228703232020.06.10 00:01:35balanceFinancing04-0.29 3973.4754.58
742228952622020.06.10 22:29:42sell0.03usdchf-e0.942550.953120.000002020.06.12 19:56:190.95312400-33.443 - usdchf-e3940.0312.14
752228952612020.06.10 22:29:42sell0.03usdchf-e0.942550.953120.935772020.06.12 19:56:190.95312400-33.444 - usdchf-e3906.59-30.27
772229171452020.06.11 00:01:32balanceFinancing0-2.53 3836.06-64
782229634452020.06.12 00:01:37balanceFinancing0-1.38 3834.68-97.44
792230073472020.06.13 00:01:51balanceFinancing0-1.05 3833.63-165.44
802230583522020.06.16 00:01:50balanceFinancing0-1.02 3832.61-167.97
812231049612020.06.17 00:01:55balanceBalance update0-0.99 3831.62-169.35
822231080582020.06.17 00:01:58balanceFinancing0-0.99 3830.63-170.4
832231088102020.06.17 00:44:15balanceBalance update00.99 3831.62-171.42
842231537272020.06.18 00:02:00balanceFinancing0-3.06 3828.56-172.41
85 3828.56-173.4
Splash
Cell Formulas
RangeFormula
O2,O4:O85O2=IF(E2="","",COUNTIF(\$E\$2:E2,E2)&" - "&E2)
P2:P85P2=P1+N2
O3O3=IF(E3="","",COUNTIF(\$E\$2:E119,E3)&" - "&E3)
T4T4=SUM(P1:P252)
T5T5=SUMIF(\$N\$2:\$N\$252,">0")
T6T6=SUMIF(\$N\$2:\$N\$252,"<0")*-1
T7T7=AVERAGE(N2:N251)
T8T8=T5/T6
U9U9=COUNTIF(A2:A254, ">0")
U10U10=COUNTIF(N2:N254,">0")
U11U11=COUNTIF(N2:N254,"<0")
U12U12=MAX(N2:N254)
U13U13=MIN(IF(F2:F252<>"",N2:N252,""))
U14U14=AVERAGEIF(N2:N254, ">0")
U15U15=AVERAGEIF(N2:N254, "<0")
U17U17=COUNTIF(C2:C254, "sell")
U19U19=COUNTIFS(C2:C254, "sell", N2:N254, ">0")
T20T20=MAX(FREQUENCY(IF(N2:N254>0,ROW(N2:N254)),IF(N2:N254<=0,ROW(N2:N254))))
T21T21=MAX(FREQUENCY(IF(N2:N255<0,ROW(N2:N255)),IF(N2:N255<=0,ROW(N2:N255))))
T22T22=MAX(Y4:Y254)
T23T23=MIN(Y4:Y254)
T24T24=SUM(K2:K254)
T26T26=U10/U9
V29V29=MIN(IF(F2:F252>0, N2:N254,"0"))
Y4Y4=N2
Y5:Y85Y5=IF(SIGN(5)=SIGN(4),Y4+N2,N2)
Press CTRL+SHIFT+ENTER to enter array formulas.

#### andrewmurray86

##### New Member
I realise that's a lot of information but it may help hopefully.

There are other alternative as well: for example excluding "Balance" from the calculation in Column D Please ignore the 0 in cloumn F,I added that to try a different formula but got the same result

#### andrewmurray86

##### New Member

I should add the target Cell is U13, you probably could have figured that out but just in case you got lost in the sea of information.

#### kweaver

##### Well-known Member
How is column F created? It appears there aren't blanks but there are 0s.

Try:
Code:
``=MIN(IF(F2:F252<>0,N2:N252,""))``

#### andrewmurray86

##### New Member
Thanks so much for you help! That formula returned -\$100 too ( data from N49).

The zeros were added after, I have removed them again, the natural state of the cell is blank. And that's how they are now.

The data is pulled from an HTML sheet which is generated from a trading program.

Is there a way to exclude "balance" from the formula (Column C), though your formulas should work, I'm really not sure why they are returning values that should be excluded??

#### kweaver

##### Well-known Member
Is the data in F actually blank in some cells or could there be a non-printing character in the cells that look blank?

I just copied all of your data from the above example, removed all the 0s from column F (made the cells blank) and used the original formula and got -42.44 as the min value in column N.

Last edited:

Replies
4
Views
167
Replies
16
Views
343
Replies
1
Views
100
Replies
33
Views
1K
Replies
1
Views
69

1,141,476
Messages
5,706,604
Members
421,460
Latest member
Taamrak

### 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.

### Which adblocker are you using?

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

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