Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Can this formula be reduced?

I have four duplicate match reports on the 'WK 1'! spreadsheet. One is used
for each match between 2 teams each week. 8 teams total in a leaque. I was
wondering how to write an Index/Match function that would search the whole
sheet (rather than each match report within the sheet) to index & match the
criteria then return the desired number. Not quite sure how to write a
shorter version.

Here's what I have: Columns go from A:AU, Rows go from 32:111
A2= team member name
'Indiv Stats'!B4= Stat to search for

=IF(ISNA(INDEX('WK 1'!$A$32:$W$56,MATCH(A2,'WK
1'!$B$32:$B$55,0),MATCH('Indiv Stats'!B4,'WK 1'!$A$32:$W$32,0))),0,(INDEX('WK
1'!$A$32:$W$56,MATCH(A2,'WK 1'!$B$32:$B$55,0),MATCH('Indiv Stats'!B4,'WK
1'!$A$32:$W$32,0))))+IF(ISNA(INDEX('WK 1'!$Z$32:$AU$56,MATCH(A2,'WK
1'!$Z$32:$Z$55,0),MATCH('Indiv Stats'!B4,'WK
1'!$Z$32:$AU$32,0))),0,(INDEX('WK 1'!$Z$32:$AU$56,MATCH(A2,'WK
1'!$Z$32:$Z$55,0),MATCH('Indiv Stats'!B4,'WK
1'!$Z$32:$AU$32,0))))+IF(ISNA(INDEX('WK 1'!$B$89:$W$111,MATCH(A2,'WK
1'!$B$89:$B$111,0),MATCH('Indiv Stats'!B4,'WK
1'!$B$89:$W$89,0))),0,(INDEX('WK 1'!$B$89:$W$111,MATCH(A2,'WK
1'!$B$89:$B$111,0),MATCH('Indiv Stats'!B4,'WK
1'!$B$89:$W$89,0))))+IF(ISNA(INDEX('WK 1'!$Z$89:$AU$111,MATCH(A2,'WK
1'!$Z$89:$Z$111,0),MATCH('Indiv Stats'!B4,'WK
1'!$Z$89:$AU$89,0))),0,(INDEX('WK 1'!$Z$89:$AU$111,MATCH(A2,'WK
1'!$Z$89:$Z$111,0),MATCH('Indiv Stats'!B4,'WK 1'!$Z$89:$AU$89,0))))

You help is appreciated,
JIM
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Can this formula be reduced?

Without knowing your actual data structure, here's what I came up with:

=SUMPRODUCT((Wk 1!$B$33:$B$55=Sheet17!A2)*(Wk 1!C32:W32='Indiv
Stats'!B4)*(Wk 1!C33:W55))
+SUMPRODUCT((Wk 1!$B$90:$B$111=Sheet17!A2)*(Wk 1!C89:W89='Indiv
Stats'!B4)*(Wk 1!C90:W111))
+SUMPRODUCT((Wk 1!$Z$33:$Z$55=Sheet17!A2)*(Wk 1!AA32:AU32='Indiv
Stats'!B4)*(Wk 1!AA33:AU55))
+SUMPRODUCT((Wk 1!$Z$90:$Z$111=Sheet17!A2)*(Wk 1!AA89:AU89='Indiv
Stats'!B4)*(Wk 1!AA90:AU111))

That reduces your formula from 840 characters to around 370

Is that something you can work with?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)

"top.jimmy" wrote in message
...
I have four duplicate match reports on the 'WK 1'! spreadsheet. One is
used
for each match between 2 teams each week. 8 teams total in a leaque. I
was
wondering how to write an Index/Match function that would search the whole
sheet (rather than each match report within the sheet) to index & match
the
criteria then return the desired number. Not quite sure how to write a
shorter version.

Here's what I have: Columns go from A:AU, Rows go from 32:111
A2= team member name
'Indiv Stats'!B4= Stat to search for

=IF(ISNA(INDEX('WK 1'!$A$32:$W$56,MATCH(A2,'WK
1'!$B$32:$B$55,0),MATCH('Indiv Stats'!B4,'WK
1'!$A$32:$W$32,0))),0,(INDEX('WK
1'!$A$32:$W$56,MATCH(A2,'WK 1'!$B$32:$B$55,0),MATCH('Indiv Stats'!B4,'WK
1'!$A$32:$W$32,0))))+IF(ISNA(INDEX('WK 1'!$Z$32:$AU$56,MATCH(A2,'WK
1'!$Z$32:$Z$55,0),MATCH('Indiv Stats'!B4,'WK
1'!$Z$32:$AU$32,0))),0,(INDEX('WK 1'!$Z$32:$AU$56,MATCH(A2,'WK
1'!$Z$32:$Z$55,0),MATCH('Indiv Stats'!B4,'WK
1'!$Z$32:$AU$32,0))))+IF(ISNA(INDEX('WK 1'!$B$89:$W$111,MATCH(A2,'WK
1'!$B$89:$B$111,0),MATCH('Indiv Stats'!B4,'WK
1'!$B$89:$W$89,0))),0,(INDEX('WK 1'!$B$89:$W$111,MATCH(A2,'WK
1'!$B$89:$B$111,0),MATCH('Indiv Stats'!B4,'WK
1'!$B$89:$W$89,0))))+IF(ISNA(INDEX('WK 1'!$Z$89:$AU$111,MATCH(A2,'WK
1'!$Z$89:$Z$111,0),MATCH('Indiv Stats'!B4,'WK
1'!$Z$89:$AU$89,0))),0,(INDEX('WK 1'!$Z$89:$AU$111,MATCH(A2,'WK
1'!$Z$89:$Z$111,0),MATCH('Indiv Stats'!B4,'WK 1'!$Z$89:$AU$89,0))))

You help is appreciated,
JIM



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Can this formula be reduced?

Thanks Ron:
WOW! That's helpful for sure...I never thought of using the Sumproduct
function. I'm going for the 'One-liner'. :o)

A each player's name only appears once on 'WK 1'!; since each player plays
in only one game per week. So I'm wondering if it's possible to search/Index
all four matches(games) for a player's name. In this case; 'A2', then match
the stat. Can the Sumproduct function search the whole sheet 'WK 1'! for the
player's name, then essentially match the particluar stat, 'Indiv Stats'!B4?
It looks like the four Sumproducts you wrote below following my original
formula can be reduced even further to a one line Sumproduct function. I
just don't know how to do it. I'm also looking to eliminate the use of
absolute cell references '$', since using them obviously makes it hard to
just copy a formula to successive cells.

"Ron Coderre" wrote:

Without knowing your actual data structure, here's what I came up with:

=SUMPRODUCT((Wk 1!$B$33:$B$55=Sheet17!A2)*(Wk 1!C32:W32='Indiv
Stats'!B4)*(Wk 1!C33:W55))
+SUMPRODUCT((Wk 1!$B$90:$B$111=Sheet17!A2)*(Wk 1!C89:W89='Indiv
Stats'!B4)*(Wk 1!C90:W111))
+SUMPRODUCT((Wk 1!$Z$33:$Z$55=Sheet17!A2)*(Wk 1!AA32:AU32='Indiv
Stats'!B4)*(Wk 1!AA33:AU55))
+SUMPRODUCT((Wk 1!$Z$90:$Z$111=Sheet17!A2)*(Wk 1!AA89:AU89='Indiv
Stats'!B4)*(Wk 1!AA90:AU111))

That reduces your formula from 840 characters to around 370

Is that something you can work with?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)

"top.jimmy" wrote in message
...
I have four duplicate match reports on the 'WK 1'! spreadsheet. One is
used
for each match between 2 teams each week. 8 teams total in a leaque. I
was
wondering how to write an Index/Match function that would search the whole
sheet (rather than each match report within the sheet) to index & match
the
criteria then return the desired number. Not quite sure how to write a
shorter version.

Here's what I have: Columns go from A:AU, Rows go from 32:111
A2= team member name
'Indiv Stats'!B4= Stat to search for

=IF(ISNA(INDEX('WK 1'!$A$32:$W$56,MATCH(A2,'WK
1'!$B$32:$B$55,0),MATCH('Indiv Stats'!B4,'WK
1'!$A$32:$W$32,0))),0,(INDEX('WK
1'!$A$32:$W$56,MATCH(A2,'WK 1'!$B$32:$B$55,0),MATCH('Indiv Stats'!B4,'WK
1'!$A$32:$W$32,0))))+IF(ISNA(INDEX('WK 1'!$Z$32:$AU$56,MATCH(A2,'WK
1'!$Z$32:$Z$55,0),MATCH('Indiv Stats'!B4,'WK
1'!$Z$32:$AU$32,0))),0,(INDEX('WK 1'!$Z$32:$AU$56,MATCH(A2,'WK
1'!$Z$32:$Z$55,0),MATCH('Indiv Stats'!B4,'WK
1'!$Z$32:$AU$32,0))))+IF(ISNA(INDEX('WK 1'!$B$89:$W$111,MATCH(A2,'WK
1'!$B$89:$B$111,0),MATCH('Indiv Stats'!B4,'WK
1'!$B$89:$W$89,0))),0,(INDEX('WK 1'!$B$89:$W$111,MATCH(A2,'WK
1'!$B$89:$B$111,0),MATCH('Indiv Stats'!B4,'WK
1'!$B$89:$W$89,0))))+IF(ISNA(INDEX('WK 1'!$Z$89:$AU$111,MATCH(A2,'WK
1'!$Z$89:$Z$111,0),MATCH('Indiv Stats'!B4,'WK
1'!$Z$89:$AU$89,0))),0,(INDEX('WK 1'!$Z$89:$AU$111,MATCH(A2,'WK
1'!$Z$89:$Z$111,0),MATCH('Indiv Stats'!B4,'WK 1'!$Z$89:$AU$89,0))))

You help is appreciated,
JIM




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
My Color Palette Reduced to 13 and will not Reset Brianne Keating Excel Discussion (Misc queries) 3 July 23rd 07 12:47 PM
How do I stop fractions from being reduced? frustratedbyautocorrect Excel Discussion (Misc queries) 3 September 12th 06 07:02 PM
How can I keep a fraction from being reduced? rdmdale Excel Worksheet Functions 3 November 10th 05 04:30 PM
Fraction in 16ths format reduced to LCD Derek Excel Worksheet Functions 1 June 16th 05 09:27 PM
Reduced Row Echelon form bigf* Excel Worksheet Functions 1 April 10th 05 12:14 PM


All times are GMT +1. The time now is 12:46 PM.

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"