Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Problem with formula

Hello All,

My problem is I got this formula, which achieve the results I want
apart from one solution. The solution that I am looking for this
formula isn't happening. The equation is: -

=IF(OR(D15="",COUNTBLANK(D17:D20)0),"",IF(COUNTIF (D17:D20,D15)=4,D15,MIN(D17:D20)))

The solution that I am looking for if any number is selected out of
D17:D20 it should be display in D15, but the equation you must select
all 4 cells from D17:D20 for the min value to display in D15.

Anyone there that can help me?


many thanks

ims

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Problem with formula

wrote:
Hello All,

My problem is I got this formula, which achieve the results I want
apart from one solution. The solution that I am looking for this
formula isn't happening. The equation is: -

=IF(OR(D15="",COUNTBLANK(D17:D20)0),"",IF(COUNTIF (D17:D20,D15)=4,D15,MIN(D17:D20)))

The solution that I am looking for if any number is selected out of
D17:D20 it should be display in D15, but the equation you must select
all 4 cells from D17:D20 for the min value to display in D15.

Anyone there that can help me?


many thanks

ims


Hi ims,

I'm not sure I understand what you are trying to do.

Sounds like you want D15 to show the value in the selected cell if that
selected cell is from the range D17:D20, but if all 4 of the D17:D20
cells are selected then you want D15 to show the minimum of the D17:D20
cell values.

I don't know of any functions that return a value depending on the
range of selected cells.
However, you could use this Worksheet_SelectionChange event
procedure...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Address
Case "$D$17:$D$20"
Range("D15").Value = WorksheetFunction.Min(Target)
Case "$D$17", "$D$18", "$D$19", "$D$20"
Range("D15").Value = Target.Value
Case Else
Range("D15").ClearContents
End Select
End Sub

To get the code in place...

1. Copy it
2. Right click the worksheet's sheet tab then choose "View Code" from
the popup menu
3. Paste the code into the worksheet module
4. Press Alt + F11 to get back to Excel
5. The code requires that Security level be Medium and Macros Enabled.
To do this go Tools|Macro|Security|Medium|OK|Close|Open|Enable Macros.

Ken Johnson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Problem with formula

Hi Ken,

Thanks for your response, but i am looking for a formula similar to the
one below with a small change.


Ken Johnson wrote:
wrote:
Hello All,

My problem is I got this formula, which achieve the results I want
apart from one solution. The solution that I am looking for this
formula isn't happening. The equation is: -

=IF(OR(D15="",COUNTBLANK(D17:D20)0),"",IF(COUNTIF (D17:D20,D15)=4,D15,MIN(D17:D20)))

The solution that I am looking for if any number is selected out of
D17:D20 it should be display in D15, but the equation you must select
all 4 cells from D17:D20 for the min value to display in D15.

Anyone there that can help me?


many thanks

ims


Hi ims,

I'm not sure I understand what you are trying to do.

Sounds like you want D15 to show the value in the selected cell if that
selected cell is from the range D17:D20, but if all 4 of the D17:D20
cells are selected then you want D15 to show the minimum of the D17:D20
cell values.

I don't know of any functions that return a value depending on the
range of selected cells.
However, you could use this Worksheet_SelectionChange event
procedure...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Address
Case "$D$17:$D$20"
Range("D15").Value = WorksheetFunction.Min(Target)
Case "$D$17", "$D$18", "$D$19", "$D$20"
Range("D15").Value = Target.Value
Case Else
Range("D15").ClearContents
End Select
End Sub

To get the code in place...

1. Copy it
2. Right click the worksheet's sheet tab then choose "View Code" from
the popup menu
3. Paste the code into the worksheet module
4. Press Alt + F11 to get back to Excel
5. The code requires that Security level be Medium and Macros Enabled.
To do this go Tools|Macro|Security|Medium|OK|Close|Open|Enable Macros.

Ken Johnson


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Problem with formula

Hi Ken,

Thanks for your response, but i am looking for a formula similar to the
one below with a small change.


Ken Johnson wrote:
wrote:
Hello All,

My problem is I got this formula, which achieve the results I want
apart from one solution. The solution that I am looking for this
formula isn't happening. The equation is: -

=IF(OR(D15="",COUNTBLANK(D17:D20)0),"",IF(COUNTIF (D17:D20,D15)=4,D15,MIN(D17:D20)))

The solution that I am looking for if any number is selected out of
D17:D20 it should be display in D15, but the equation you must select
all 4 cells from D17:D20 for the min value to display in D15.

Anyone there that can help me?


many thanks

ims


Hi ims,

I'm not sure I understand what you are trying to do.

Sounds like you want D15 to show the value in the selected cell if that
selected cell is from the range D17:D20, but if all 4 of the D17:D20
cells are selected then you want D15 to show the minimum of the D17:D20
cell values.

I don't know of any functions that return a value depending on the
range of selected cells.
However, you could use this Worksheet_SelectionChange event
procedure...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Address
Case "$D$17:$D$20"
Range("D15").Value = WorksheetFunction.Min(Target)
Case "$D$17", "$D$18", "$D$19", "$D$20"
Range("D15").Value = Target.Value
Case Else
Range("D15").ClearContents
End Select
End Sub

To get the code in place...

1. Copy it
2. Right click the worksheet's sheet tab then choose "View Code" from
the popup menu
3. Paste the code into the worksheet module
4. Press Alt + F11 to get back to Excel
5. The code requires that Security level be Medium and Macros Enabled.
To do this go Tools|Macro|Security|Medium|OK|Close|Open|Enable Macros.

Ken Johnson


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Problem with formula

Hi ims,

If my interpretation of your aim is correct, then I'm almost certain
there isn't a formula that will do that.

I could email a worksheet with the code inplace if you like.

Ken Johnson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Problem with formula

Many thanks Ken but No thanks, I have too many formulas on one sheet
with the same output.

Cheers anyway

Ims


Ken Johnson wrote:
Hi ims,

If my interpretation of your aim is correct, then I'm almost certain
there isn't a formula that will do that.

I could email a worksheet with the code inplace if you like.

Ken Johnson


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Another formula problem Lloyd Excel Discussion (Misc queries) 1 August 2nd 07 04:13 AM
Formula Problem Secret Squirrel Excel Discussion (Misc queries) 3 August 2nd 07 03:01 AM
Formula Problem roxiemayfield Excel Worksheet Functions 2 May 9th 07 04:25 PM
formula problem Rao Ratan Singh New Users to Excel 1 April 18th 06 03:41 PM
formula problem thinkpic Excel Programming 1 November 1st 05 10:18 PM


All times are GMT +1. The time now is 03:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"