I'm stuck on a silly formula ... help plz! Not that easy...

Toddcan

New Member
Joined
Apr 14, 2002
Messages
11
I want to do this, but I can't figure out how...


in cell A, I want to return the following number...

the minimum value GREATER than zero when performing a simple subtraction of Cell B -Cell (C..F).



eg- Cell B has the number 5
Cell range c..f contain the following numbers: 3,6,7,9


I want a formula to compare the results of 5-3, 5-6, 5-7, 5-9 and return the smallest non-negative number to cell A. The answer in this case is 2.



But, how do I write a formulae to do this? I'm not an excel newbie, so it's ticking me off :)
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Array-enter:

=MIN(IF(B1-(C1:F1)>0,B1-(C1:F1)))

In order to array-enter a formula, hit control+shift+enter, instead of just enter.

Aladin
 
Upvote 0
A nice little problem with a solution that will need you to go into Array Formulas.

Enter the formulas as below but do NOT press enter.

=MIN(IF($B$2-C2:F2>0,$B$2-C2:F2,""))


Instead you must press and hold

<Ctrl> + <Shift> and then Press Enter.

If you have entered it correctly you will now see in the formula bar.

{=MIN(IF($B$2-C2:F2>0,$B$2-C2:F2,""))}

and you will see the correct answer in cell A1.

Excel Help is good if you search for Array Formula if you want to learn more about these powerful functions.
 
Upvote 0

Forum statistics

Threads
1,215,062
Messages
6,122,925
Members
449,094
Latest member
teemeren

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