PC Review


Reply
Thread Tools Rate Thread

Custom Function Desired

 
 
FARAZ QURESHI
Guest
Posts: n/a
 
      27th Dec 2007
I want to create a custom function like:

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

How to give it a correct and complete form?

Thanx!
 
Reply With Quote
 
 
 
 
Joe
Guest
Posts: n/a
 
      27th Dec 2007
On Dec 27, 8:54*am, FARAZ QURESHI
<FARAZQURE...@discussions.microsoft.com> wrote:
> I want to create a custom function like:
>
> Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
> MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY2>0),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:B10>D2,"1","0")*C1: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


 
Reply With Quote
 
FARAZ QURESHI
Guest
Posts: n/a
 
      27th Dec 2007
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
> <FARAZQURE...@discussions.microsoft.com> wrote:
> > I want to create a custom function like:
> >
> > Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
> > MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY2>0),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:B10>D2,"1","0")*C1: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
>
>
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      27th Dec 2007
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" <(E-Mail Removed)> wrote in message
news:f839d275-035e-4f23-8e26-(E-Mail Removed)...
On Dec 27, 8:54 am, FARAZ QURESHI
<FARAZQURE...@discussions.microsoft.com> wrote:
> I want to create a custom function like:
>
> Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
> MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY2>0),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:B10>D2,"1","0")*C1: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



 
Reply With Quote
 
FARAZ QURESHI
Guest
Posts: n/a
 
      27th Dec 2007
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" <(E-Mail Removed)> wrote in message
> news:f839d275-035e-4f23-8e26-(E-Mail Removed)...
> On Dec 27, 8:54 am, FARAZ QURESHI
> <FARAZQURE...@discussions.microsoft.com> wrote:
> > I want to create a custom function like:
> >
> > Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
> > MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY2>0),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:B10>D2,"1","0")*C1: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
>
>
>
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      27th Dec 2007
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" <(E-Mail Removed)> wrote in message
news:5DC26ECF-E6AC-412D-B8F5-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:f839d275-035e-4f23-8e26-(E-Mail Removed)...
>> On Dec 27, 8:54 am, FARAZ QURESHI
>> <FARAZQURE...@discussions.microsoft.com> wrote:
>> > I want to create a custom function like:
>> >
>> > Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
>> > MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY2>0),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:B10>D2,"1","0")*C1: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
>>
>>
>>
>>



 
Reply With Quote
 
Joe
Guest
Posts: n/a
 
      1st Jan 2008
On Dec 27 2007, 3:47*pm, "Bob Phillips" <bob....@somewhere.com> 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" <FARAZQURE...@discussions.microsoft.com> wrote in message
>
> news:5DC26ECF-E6AC-412D-B8F5-(E-Mail Removed)...
>
>
>
> > 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" <Joe.Varghese.J...@gmail.com> wrote in message
> >>news:f839d275-035e-4f23-8e26-(E-Mail Removed)....
> >> On Dec 27, 8:54 am, FARAZ QURESHI
> >> <FARAZQURE...@discussions.microsoft.com> wrote:
> >> > I want to create a custom function like:

>
> >> > Public Function MyFormula(ARRAY1, ARRAY2, ARRAY3, STRING)
> >> > MyFormula=SUMPRODUCT(--(ARRAY1=STRING),--(ARRAY2>0),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:B10>D2,"1","0")*C1: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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
CUSTOM FUNCTION DESIRED FARAZ QURESHI Microsoft Excel Misc 6 1st Dec 2007 04:59 AM
which function can get the desired result? ADK Microsoft Excel Worksheet Functions 3 9th May 2007 03:10 PM
Custom file menu used to redirect to desired sheet =?Utf-8?B?Sk5X?= Microsoft Excel Programming 1 18th May 2006 09:56 PM
IIf function not producing desired results Hugh Microsoft Access Reports 1 22nd Mar 2004 11:18 PM
Re: concatenate function not working as desired Sidney Linkers Microsoft Access Queries 0 17th Oct 2003 12:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:22 PM.