Array using LEN to specify selection criteria

mitchv3

New Member
Joined
Apr 19, 2011
Messages
24
I am currently working with some variable data that requires several sum ifs to get a final workable number.

I can get most of them, but am having trouble selecting only the data that is 13 characters long in Column F.

Below is what I currently have (that works). I assume I need to use LEN for column F, but cannot seem to get it to work correctly.

{=SUM(IF(A:A=$M$2,1,0)*(SUM(IF(B$3:B$65536=$N$2:$T$2,1,0)*(K$3:K$65536)))/SUM(IF(A:A=$M$2,1,0)*SUM(IF(B$3:B$65536=$N$2:$T$2,1,0)*(G$3:G$65536))))}


This is my first post, so let me know if there is more info needed and I will be glad to add, but trying to keep this as short as possible.

Thanks,
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I am currently working with some variable data that requires several sum ifs to get a final workable number.

I can get most of them, but am having trouble selecting only the data that is 13 characters long in Column F.

Below is what I currently have (that works). I assume I need to use LEN for column F, but cannot seem to get it to work correctly.

{=SUM(IF(A:A=$M$2,1,0)*(SUM(IF(B$3:B$65536=$N$2:$T$2,1,0)*(K$3:K$65536)))/SUM(IF(A:A=$M$2,1,0)*SUM(IF(B$3:B$65536=$N$2:$T$2,1,0)*(G$3:G$65536))))}


This is my first post, so let me know if there is more info needed and I will be glad to add, but trying to keep this as short as possible.

Thanks,

If you are not on Excel 2007 or later, you must avoid referencing whole columns...

Guessing from the formula you posted...

Control+shift+enter, not just enter:
Code:
=SUM(
   IF(A$3:A$400=$M$2,
   IF(ISNUMBER(MATCH(B$3:B$400,$N$2:$T$2,0)),
    K$3:K$400)))/
  SUM(
   IF(A$3:A$400=$M$2,
   IF(ISNUMBER(MATCH(B$3:B$400,$N$2:$T$2,0)),
    G$3:G$400)))
 
Upvote 0
That is a lot cleaner.

But how would I add in the check to see if Column F LEN = $M$1 then do the remainder of the calculation?
 
Upvote 0
That is a lot cleaner.

But how would I add in the check to see if Column F LEN = $M$1 then do the remainder of the calculation?

Do you mean adding a LEN test as a term in both the nominator and denominator? If so...
Code:
=SUM(
   IF(A$3:A$400=$M$2,
   IF(ISNUMBER(MATCH(B$3:B$400,$N$2:$T$2,0)),
   IF(LEN(F$3:F$400)=$M$1,
    K$3:K$400)))/
  SUM(
   IF(A$3:A$400=$M$2,
   IF(ISNUMBER(MATCH(B$3:B$400,$N$2:$T$2,0)),
   IF(LEN(F$3:F$400)=$M$1,
    G$3:G$400)))
 
Upvote 0

Forum statistics

Threads
1,224,591
Messages
6,179,766
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top