Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Custom Function Desired

I want to create a custom function like:

Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY20),ARRAY3)

How to give it a correct and complete form?

Thanx!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Custom Function Desired

On Dec 27, 8:54*am, FARAZ QURESHI
wrote:
I want to create a custom function like:

Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY20),ARRAY3)

How to give it a correct and complete form?

Thanx!


Hi Faraz,

you dont have to create a custom function.

Assume the following
-----------------
Array1 = A1:A10
Array2 = B1:B10
Array3 = C1:C10
STRING = D1
Limit = D2



1. Write the following code into a new cell. (Do not press ENTER)
=SUM(IF(A1:A10=D1,"1","0")*IF(B1:B10D2,"1","0")*C 1:C10)

2. Press CTRL + SHIFT + ENTER.
this will encapsulate it in { }. Now it is an array and should work
for you.
Note: Make sure that the array size same everywhere.

HTH
Joe


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Custom Function Desired

I know how to determine such a result. But I want to create a custom function!
A further refined formula is the one already presented in the body!

"Joe" wrote:

On Dec 27, 8:54 am, FARAZ QURESHI
wrote:
I want to create a custom function like:

Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY20),ARRAY3)

How to give it a correct and complete form?

Thanx!


Hi Faraz,

you dont have to create a custom function.

Assume the following
-----------------
Array1 = A1:A10
Array2 = B1:B10
Array3 = C1:C10
STRING = D1
Limit = D2



1. Write the following code into a new cell. (Do not press ENTER)
=SUM(IF(A1:A10=D1,"1","0")*IF(B1:B10D2,"1","0")*C 1:C10)

2. Press CTRL + SHIFT + ENTER.
this will encapsulate it in { }. Now it is an array and should work
for you.
Note: Make sure that the array size same everywhere.

HTH
Joe



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Custom Function Desired

See response in excel.misc. You know better than to multi-post by now!

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Joe" wrote in message
...
On Dec 27, 8:54 am, FARAZ QURESHI
wrote:
I want to create a custom function like:

Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY20),ARRAY3)

How to give it a correct and complete form?

Thanx!


Hi Faraz,

you dont have to create a custom function.

Assume the following
-----------------
Array1 = A1:A10
Array2 = B1:B10
Array3 = C1:C10
STRING = D1
Limit = D2



1. Write the following code into a new cell. (Do not press ENTER)
=SUM(IF(A1:A10=D1,"1","0")*IF(B1:B10D2,"1","0")*C 1:C10)

2. Press CTRL + SHIFT + ENTER.
this will encapsulate it in { }. Now it is an array and should work
for you.
Note: Make sure that the array size same everywhere.

HTH
Joe



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Custom Function Desired

THANX BOB!!!!!!!!!!!!!

U really made my problems solved!

I am really sorry for double posting but I was actually receiving no
response and had presumed that it might have been overlooked!

Thanx again buddy!

"Bob Phillips" wrote:

See response in excel.misc. You know better than to multi-post by now!

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Joe" wrote in message
...
On Dec 27, 8:54 am, FARAZ QURESHI
wrote:
I want to create a custom function like:

Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY20),ARRAY3)

How to give it a correct and complete form?

Thanx!


Hi Faraz,

you dont have to create a custom function.

Assume the following
-----------------
Array1 = A1:A10
Array2 = B1:B10
Array3 = C1:C10
STRING = D1
Limit = D2



1. Write the following code into a new cell. (Do not press ENTER)
=SUM(IF(A1:A10=D1,"1","0")*IF(B1:B10D2,"1","0")*C 1:C10)

2. Press CTRL + SHIFT + ENTER.
this will encapsulate it in { }. Now it is an array and should work
for you.
Note: Make sure that the array size same everywhere.

HTH
Joe






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Custom Function Desired

Faraz,

It generally won't get overlooked as most of us will check out all of the
major Excel groups. If it isn't getting answered it will probably mean that
there are few people online, so just be a bit patient.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"FARAZ QURESHI" wrote in message
...
THANX BOB!!!!!!!!!!!!!

U really made my problems solved!

I am really sorry for double posting but I was actually receiving no
response and had presumed that it might have been overlooked!

Thanx again buddy!

"Bob Phillips" wrote:

See response in excel.misc. You know better than to multi-post by now!

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Joe" wrote in message
...
On Dec 27, 8:54 am, FARAZ QURESHI
wrote:
I want to create a custom function like:

Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY20),ARRAY3)

How to give it a correct and complete form?

Thanx!


Hi Faraz,

you dont have to create a custom function.

Assume the following
-----------------
Array1 = A1:A10
Array2 = B1:B10
Array3 = C1:C10
STRING = D1
Limit = D2



1. Write the following code into a new cell. (Do not press ENTER)
=SUM(IF(A1:A10=D1,"1","0")*IF(B1:B10D2,"1","0")*C 1:C10)

2. Press CTRL + SHIFT + ENTER.
this will encapsulate it in { }. Now it is an array and should work
for you.
Note: Make sure that the array size same everywhere.

HTH
Joe






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Custom Function Desired

On Dec 27 2007, 3:47*pm, "Bob Phillips" wrote:
Faraz,

It generally won't get overlooked as most of us will check out all of the
major Excel groups. If it isn't getting answered it will probably mean that
there are few people online, so just be a bit patient.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"FARAZ QURESHI" wrote in message

...



THANX BOB!!!!!!!!!!!!!


U really made my problems solved!


I am really sorry for double posting but I was actually receiving no
response and had presumed that it might have been overlooked!


Thanx again buddy!


"Bob Phillips" wrote:


See response in excel.misc. You know better than to multi-post by now!


--
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)


"Joe" wrote in message
....
On Dec 27, 8:54 am, FARAZ QURESHI
wrote:
I want to create a custom function like:


Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY20),ARRAY3)


How to give it a correct and complete form?


Thanx!


Hi Faraz,


you dont have to create a custom function.


Assume the following
-----------------
Array1 = *A1:A10
Array2 = *B1:B10
Array3 = *C1:C10
STRING = *D1
Limit *= *D2


1. Write the following code into a new cell. (Do not press ENTER)
=SUM(IF(A1:A10=D1,"1","0")*IF(B1:B10D2,"1","0")*C 1:C10)


2. Press CTRL + SHIFT + ENTER.
this will encapsulate it in { }. *Now it is an array and should work
for you.
Note: Make sure that the array size same everywhere.


HTH
Joe- Hide quoted text -


- Show quoted text -



Ahh.. That works better.. This is new to me.. I used to the Array
Way..
But what is the significance of "--". Is it that we have to put "--"
before the array comparison ??

Thanks
Joe
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
Add-in - add a custom function to a custom group. Spencer Hutton Excel Programming 1 December 4th 07 02:53 PM
CUSTOM FUNCTION DESIRED FARAZ QURESHI Excel Discussion (Misc queries) 6 December 1st 07 04:59 AM
which function can get the desired result? ADK Excel Worksheet Functions 3 May 9th 07 03:10 PM
Custom file menu used to redirect to desired sheet JNW Excel Programming 1 May 18th 06 09:56 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM


All times are GMT +1. The time now is 06:25 AM.

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

About Us

"It's about Microsoft Excel"