SUMPRODUCT Evaluation for TRUE or FALSE for all the Meeting Criterions?
Dear Forum,
I am using the Sumpropduct funtion and quite satisfactorily its giving me results, however I need to use it as TRUE or FALSE to categorsie certain responses and these are given by combining the SUMPRODUCT with a regular IF condition..
I would like to know whether the Criteria is met for the Entire Range or NOT.?
If it does there would be a Particular response and if not then some other, so how do I get the same..
Due to confidential reasons I am unable to post the sample workbook but can provide the code to give an Idea..
In the above code there are 2 Instances where the values are "" so the answer I get is 2 but there are THREE ROWS AS per the SubSrNo Col so I want to check whether the condition matches with all the Three Rows..IF(SUMPRODUCT(--(SubSrNoRng=$B2)*(CashAmtRng="")*(ChqAmtRng="")*(RTGS_NEFTAmtRng="")*(CrdtCardAmtRng="")),"Cond_I","Cond_II"
So, how do I get that result, I mean is there a way of getting the Result 3 Rows and then Matching whether all the criterions are Matching for the 3 Rows.?
Warm Regards
e4excel
If as implied you are using XL2007 perhaps:
In SUMPRODUCT terms=IF(COUNTIFS(SubSrNoRng,B2,CashAmtRng,"",ChqAmtRng,"",RTGS_NEFTAmtRng,"",CrdtCardAmtRng,"")=COUNTIF(SubSrNoRng,$B2),"Cond_I","Cond_II")
It might be the case you could simply reverse the logic rather than use an equality test...in SUMPRODUCT terms:=IF(SUMPRODUCT((SubSrNoRng=$B2)*(CashAmtRng&ChqAmtRng&RTGS_NEFTAmtRng&CredtCardAmtRng=""))=COUNTIF(SubSrNoRng,$B2),"Cond_I","Cond_II")
All of the above assumes "3" is determined by count of SubSrNoRng = $B2 rather than 3 entries in that Named Range... if the latter use a pre-emptive reverse COUNTIF test to test for alternative entries in first instance.=IF(SUMPRODUCT((SubSrNoRng=$B2)*(CashAmtRng&ChqAmtRng&RTGS_NEFTAmtRng&CredtCardAmtRng<>"")),"Cond_II","Cond_I")
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Hi,
These sorts of things are usually easier to answer if we can see the problem in the context of its workbook. Since your data is confidential we don't need to see the real names, or indeed amounts. Just create a working copy and anonymise it as necessary, then upload it along with manually calculated results that you expect to see and add some specific notes explain how you arrive at the results.
Just a thought though. Are you using SUMPRODUCT() because this is a legacy formula from XL 2003. I see you have XL 2007 and hence SUMIFS() formula may be more appropriate.
Regards
Richard Buttrey
If this was useful then please rate it appropriately.
Click the small star iconat the bottom left of my post.
Thanks a lot Richard, I will try to create a dummy workbook as I have lot of queries with respect to the file...
This file maybe circulated with other lower versions of excel and therfore I chose to go with Sumproduct rather than IFs Family of Functions..
I liked the idea of the concatenation of all the criterions and reversing the logic but actually I needed to get the TRUE or FALSE in a Single Formula but maybe thats not possible , is it?
Timebeing I will use the COUNTIF and SUMPRODUCT combination but if there was something additional I could use in a single formula that would have been great as I have several instances to use such scenarios..
REgards
I don't really follow the above. Reversing the logic results in a single SUMPRODUCT calculation does it not ?Originally Posted by e4excel
Perhaps you could elaborate on the requirements - ideally with a sample file per Richard's suggestion.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Dear DonkeyOte and Richard,
Please find the dummy file attached..
Actually, I am trying to update the Booking Status by explicitly entering fixed amounts in the Payment Details Sheet which will decide the Booking Status.. such as mentioned below:
There are Categories in the Booking Status for the Plots on Sale.
1. Blocked - By Paying just Re 1/- we need to change the Status to "Blocked"..This Re 1/- would not get added in the Total Payment for that Plot and the particualr Purchaser. This category is created to avoid sales conflict and protect business interest amongst Sales Team, we just add a small amount as Rs 1/- in the form of Cash to Block a Plot.
( In reality, even if there are more than 2 people who have pitched for the same Plot which was Un-Sold the one who brings in the Payment-Cheque gets the Sale in his Name )
The Moment we add the actual amount in the different Modes then it should get converted to the status as "Booked".
Maybe if possible if we could time this Status for a Duration for 3 days and then Automatically it changes to Un-Sold unless acted upon explicitly by the data entry person.
2. Booked- As explained when the Actual Payment is recorder for any Plot which was previously never Purchased or was Un-Sold is termed as "Booked". A "Booked" plot can have an existing status as "Blocked".
3. Cancelled-Un-Sold - The Client has changed his mind and wants to cancel his deal so we put a (Negative amount os - Rs 2/-) to change the Status to Cancelled-Un-Sold to have it in records that this was originally booked and now cancelled.This means that this is a PLot which was actually Sold but presently cancelled..The Rs -2/- is again entered in the Cash Amount Column to change the Status.
4. Cancelled-Booked - When any Client buys a Plot which was already cancelled in our records then it will not be fresh booking and therefore to differentiate between a fresh deal and a cancelled deal we call it as "Cancelled-Booked " So the same Plot No initially "Cancelled_Un-Sold" if Booked again would be considered as Cancelled-Booked and not just Booked.
Please note that we dont need to record the Blocked aspect as Cancelled_Blocked as "Blocked" is a terminology to make the Sales Team aware as to which Plots are already under consideration so that they can avoid pitching for the same plots but as explained earlier incase if there are 2 Different Clients dealing with 2 Different Sales Mgrs then whoever brings in the Cheque first will crack the deal..
Un-Sold - All Plots which are not "Booked" or "Cancelled-Un-Sold" by default are "Un-Sold"..
The problem I am facing is that when there are cancellations for the Plot the Plot Nos remain the same but the Purchaser's Name Changes so I need to keep a track of different deals for the same Plot Nos.
There are certain complexities such as when one client purchasers more than one Plot and cancelles one of them as well as I wanted to create a category of "Double-Deal" incase there is Double Booking for a Plot which is not cancelled..
So either I need to have a certain condition in Data Validation which prevents the entry of the Name of a different person incase there is no cancellation of that particualr Plot.
Warm Regards
e4excel
e4excel - if I am honest the above is sufficiently convoluted that I won't be able to come back with anything meaningful.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Dear DO,
Its indeed very complicated and therefore I am getting confused in seperating each category as I am unable to distinguish the unique quality of each category, when I look at it individually it gets done but when combined it fails...
I actually wanted to know whether I can count the no of instances when oe Plot is mentioned with different Client Names as mentioned the Plot No is repated twice with different Names so how can I get the answer 2?
can you please suggest a better approach if this is too complex..
Would really appreciate some help as this is Status is holding me down for a long time.
Please ..
P.S. I have already worked on the total payments concept and forgot to mention that for a cheque payment we need to select the drop-down as Cleared and for any payment we also need to select the drop-dopwn as "Regular Payments".
Regards
e4excel
Is it possible to get the No of Times the Plot is used for Different Names?
I am getting lost in this step..
I think I found something which gives me the naswer but not quite happy the way I am using it,
I want to use the Same Defined Names in theSUMPRODUCT(--(PlotNoRng=C2)*(PlotNoRng&PurcNameRng<>"")/COUNTIF(Y2:Y8,Y2:Y8))but unable to use so is there a way I could get the same result in this fashion so that I can avoid the Helper Column Y if possible..COUNTIF(PlotNoRng&PurcNameRng,PlotNoRng&PurcNameRng)
Regards
e4excel
Wow, I found something without using the countif..and that again is DOnkeyOtes brainchild...
http://www.excelforum.com/excel-prog...f-formula.html
SO now I get the answer 2 which is the correct answer for the same plot no...SUMPRODUCT(--(PlotNoRng=C2)*(PlotNoRng&PurcNameRng<>""),--(MATCH(PlotNoRng&"@"&PurcNameRng,PlotNoRng&"@"&PurcNameRng,0)=(ROW(PlotNoRng)-ROW($C$2)+1)))
Thanks DOnkeyOte for your everlasting codes which have helped numerous people like me all over..
Regards
e4excel
But i would still insist if theres some changed required in my deisgn please let me know so that i can incorporate them in my sheet..
Last edited by e4excel; 12-28-2011 at 03:25 PM.
Dear DO,
I have used your SUMPRODUCT formula from the other thread to good efect but when I wanted to do a Running Formula and shortened the range to gradual increase like $C$2:$C2 it gives me an error in the Match Formula..
Can you please guide me on that please..
By attaiing this stp I can do away with the Helper Column Y in my Sheet..
I dont know for some strange reason this does not work and gives an error in the Match Formula..=SUMPRODUCT(--(CCol&DCol<>""),--(MATCH(CCol&"@"&DCol,CCol&"@"&DCol,0)=(ROW($C$2:$C2)-ROW($C$2)+1))) CCol = INDIRECT(SUBSTITUTE(ADDRESS(1,MATCH('Payment Details'!$C$1,'Payment Details'!$1:$1,0),1),"1","",1)&"2:"&SUBSTITUTE(ADDRESS(1,MATCH('Payment Details'!$C$1,'Payment Details'!$1:$1,0),1),"1","",1)&ROW()) DCol = INDIRECT(SUBSTITUTE(ADDRESS(1,MATCH('Payment Details'!$D$1,'Payment Details'!$1:$1,0),1),"1","",1)&"2:"&SUBSTITUTE(ADDRESS(1,MATCH('Payment Details'!$D$1,'Payment Details'!$1:$1,0),1),"1","",1)&ROW())
MATCH(CCol&"@"&DCol,CCol&"@"&DCol,0)
When I used it earlier with the PlotNoRng and PurcNameRng they were bigger Ranges but I want to do it gradually iin a running fashion..
SO please tell me why is there an error?
Regards
e4excel
Please outline the expected results on a row by row basis (i.e should the test not be specific to the Plot No. of the row being calculated ?)
FWIW, I would be inclined to avoid prodigious use of INDIRECT with your named ranges. I suspect you could use INDEX to build the vast majority which would offer shorter syntax and would have added advantage of being non-volatile.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
I'm not going to be around that much so to get things moving....
First, select cell C2 and modify RefersTo for both CCol and DCol:
Notes:CCol = INDEX('Payment Details'!$1:$1,MATCH('Payment Details'!$C$1,'Payment Details'!$1:$1,0)):INDEX('Payment Details'!2:2,MATCH('Payment Details'!$C$1,'Payment Details'!$1:$1,0)) DCol = INDEX('Payment Details'!$1:$1,MATCH('Payment Details'!$D$1,'Payment Details'!$1:$1,0)):INDEX('Payment Details'!2:2,MATCH('Payment Details'!$D$1,'Payment Details'!$1:$1,0))
- above deliberately commence from row 1 (as opposed to 2) thus ensuring MATCH range is always > 1 row.
- I have assumed in your real file your criteria value of the MATCH is not performed against the header row of the same sheet - if it were there is simply no need for the MATCH (you know the column by virtue of criteria)
Notes:AB2: =SUMPRODUCT(--(CCol&DCol<>""),--(MATCH(CCol&"@"&DCol,CCol&"@"&DCol,0)=(ROW($C$1:$C2)-ROW($C$1)+1)))-1
The above returns running unique count rather than running unique count per plot.
The -1 is to remove unique result attributable to the header from the resulting value.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks