SUMPRODUCT Using Named Ranges
Mar 27, 2014
I am using the SUMPRODUCT formula below and it seems to be working
=SUMPRODUCT(('Attendance Data'!H:H="XXX")*('Attendance Data'!D:D="YYY"))
This, as I understand it is counting the number of times a row contains the text "XXX" in column H and also contains the text "YYY" in column D.
This seems to work for me.
Now my problem is when I want to change the formula to search for the text "XXX" in column H and also any text that apperas in a named range on another sheet in column D. The named range is called "New_Starters"
I am using the below formula which is returning N/A's.
=SUMPRODUCT(('Attendance Data'!D:D=New_Starters)*('Attendance Data'!H:H="XXX"))
View 4 Replies
ADVERTISEMENT
Apr 28, 2014
I have written this macro to convert into a csv file to run for all defined named ranges in the activesheet. It run jst perfect when I hit SAVE button and it creates that many different CSV files for each named range.
However I am trying to use same macro in the another file and the problem I am facing is there a lot more named ranges and I want to run the macro for only selected NAMED RANGE. In this case 2 Named Range / 24 Named range.
What part of code do I need to change and to what to make it work for just 2 named ranges ?
View 6 Replies
View Related
Jun 2, 2006
I need to create a named range on multiple sheets with the same named range & i cant figure out how to do this. EG :- I want to create a named range called "_SubUnitRows" on sheet1 starting from "A1:A50" & other named range again called "_SubUnitRows" on Sheet2 starting from "A1:A25" ...
View 2 Replies
View Related
Mar 14, 2013
Merge two columns into one list in excel
I would like to combine List1 and List2 into a 3rd named range called List3. I was wondering if this were possible without using any additional cells/columns (i.e. I don't want to use Column C like in the example shown in the link above).
Here's the formula from the example:
Code:
=IFERROR(INDEX(List1,ROWS(C1:$C$1)),IFERROR(INDEX(List2,ROWS(C1:$C$1)-ROWS(List1)),""))
I've played around with it, but could not come with any that worked.
View 3 Replies
View Related
Mar 26, 2007
Why won't this SUMPRODUCT work?
SUMPRODUCT(Sheet2!D1:D2000=OPEN,Sheet2!F1:F2000)
I have a range (D1:D2000) that contains a 'Status' value.
OPEN is a named range that refers to eight possible Status values: Assigned, New, Hold, Re-test, In Progress, Failed, Ready for Push, Coded
The formula should sum the values in F1:F2000 for any row containing one of the eight statuses in D1:D2000.
View 9 Replies
View Related
Feb 13, 2008
I'm still using XL2003 (Heck, they JUST upgraded from 2002 last year! So at this rate, I'll probably get 2007 here in the office by 2012).
I have a few named ranges that use Indirect & Count functions to auto-adjust the range to the last row. Something like this.
Name: ProjectID
Range: Sheet1!$A:INDIRECT("$A$"&COUNT($A:$A))
When I try to include the named range in a sumproduct statement, it crashes XL the moment I type the evaluative sign (< = >) within the 2nd bracket. Like this:
=SUMPRODUCT(--(ProjectID>2500))
(The actual formula works on several other columns of data. I'm citing a simple example, which also crashes my XL.)
Is that my installation causing the error or something wacko in XL? Please try and write back.
View 9 Replies
View Related
Nov 5, 2008
I'm attempting to do a sumproduct with different dimensioned ranges. I've read multiple posts that say that all ranges in a sumproduct must have the same dimensions. I've tried different commands (index/match/lookup, etc) with no luck. Perhaps someone can come up with a solution for me....
View 7 Replies
View Related
Aug 7, 2007
I can't get the following formula to work...
SUMPRODUCT((Range1Range2)*(DollarValue))
Basically I have a master sheet of data:
Range1 DollarValue
AAA 20
BBB 35
CCC 5
DDD 10
and a separate sheet with items i want excluded from the calc:
Range2
BBB
DDD
I want the SUMPRODUCT to give me a value of 25 (AAA + CCC, excluding BBB and DDD from the calc). However, I'm getting #N/A in my formula cell. Is there an easy way to do this other than specifying each value to exclude, e.g. SUMPRODUCT((Range1"BBB")*(Range1"DDD")*(DollarValue))
I have a lot of values to exclude, so this could get very hard to manage...
View 9 Replies
View Related
Oct 2, 2007
I have a weird problem with some cells calculating (for example) =sumproduct(bundleNoNRP, bundleNoQTY). There are a number of cells with similar formulas calcutating with named ranges, and they all display #Value (a value of the wrong data type is used in this formula).
Both these ranges are set up via a VB program.
If i just seperately on the sheet do the sum of either of these ranges it works fine.
What could be going wrong? Is there some way of checking whats in the ranges? I cant see why the data type would be wrong if I can do sum calcs ok..Is there some rule which would mean the calculation wouldn't work anymore? This is part of a much larger VBA project so I hope I have provided enough information.
View 9 Replies
View Related
May 2, 2007
I'm having a fit with this formula; maybe the gurus will show me what I'm doing wrong. I have a list of area numbers along with dollar amounts that go with these area numbers. I have created a named range named "Areas" and another one named "MO_PD".
At the bottom of the worksheet I am doing a recap that takes the area number and sums all the entries in the MO PD column. This approach has been done before with Thomach's help. I'm trying to mimic it, but it's not working for me.
NOTE - I know that I can get around this using a pivot table, but I would like to use this approach for now. I would at least like to know what I'm doing wrong. Also, I'm not totally sure if I did the dynamic named ranges correctly so that may need to be fixed.
View 9 Replies
View Related
Feb 11, 2012
The formula is =SUMPRODUCT((Group="A")*(Project_Description="Long Term")*(Profile="B")*(INDIRECT(B9)="x"))
B9 through M9 have header text Jan_2012, Feb_2012...Dec_2012. Basically my aim is to get the above formula working before I drag it across so that the named ranges get picked up automatically from the headers.
Jan_2012 thru Dec_2012 are dynamic named ranges using INDEX (and not OFFSET as someone mentioned OFFSET is a volatile function).
The above SUMPRODUCT formula is giving me a #REF! error for the (INDIRECT(B9)="x") part. I know that because when I replace it with (Jan_2012="x") it works fine.
I realized while writing this that it may be because the named range in Jan_2012 is not the same size as that of other arrays. [but it is the same size - I've re-confirmed just now]
View 5 Replies
View Related
Sep 15, 2014
I am trying to make a UDF that searches for a header, grabs everything under the header, and pulls it somewhere else. My UDF has three parameters:
1) Output_Range: the named range where the parameters will be pulled to
2) Header: the header to search for in order to copy the data underneath it
3) WorkbookName: the name of the workbook to search in
It looks like this:
VB:
Function LoadParameters(Output_Range As Range, Header, WorkbookName As String)
MyTimer = Timer
'Defining the variables.
Dim HeaderCell, HeaderCellEnd, HeaderRange, Output_Range
[Code]....
View 3 Replies
View Related
Dec 30, 2008
I have some named ranges that refer to 5 pieces of data organized into a row. For example, the name MyNamedRange might refer to $C$5:$C$10.
I am trying to loop through each column and get the values in MyNamedRange, then change corresponding values in a different named range. However, when I try to use Offset to access the subsequent columns of MyNamedRange, it doesn't work. It only gets the value of the first column right, the rest return <EMPTY>.
Sample .......
View 10 Replies
View Related
Jul 17, 2006
How do I go about using named ranges instead of cell names(ie A4:A9)
Private Sub UserForm_Activate()
Dim lngRow As Long
Dim intIndex As Integer
UserForm1.ComboBox1.Clear 'Clear combobox
lngRow = 2 Do While Sheet1.Range("a" & lngRow).Value <> ""
For intIndex = 0 To UserForm1.ComboBox1.ListCount - 1
If UserForm1.ComboBox1.List(intIndex) = Sheet1.Range("a" & lngRow).Value
Then
Goto NextRow
End If
Next intIndex
UserForm1.ComboBox1.AddItem Sheet1.Range("a" & lngRow).Value
NextRow:
lngRow = lngRow + 1
Loop
End Sub
I wanted to change "a" to the defined range "search"?
View 7 Replies
View Related
Dec 5, 2007
the code to add two independent named ranges cell by cell in vba. Both of the named ranges have the same structure and the sum would be posted to a third area of the same structure cell wise.
View 7 Replies
View Related
Jul 2, 2009
My problem is :
1.In G Column I put logic for Fail and Obtained Marks.
G2=IF(COUNTIF(B2:F2,">=60")=5,SUM(B2:F2),"Fail")
2. Now in H column I want use this formula which I obtained from this forum
H2=SUMPRODUCT((G$2:G$7>G2)/COUNTIF(G$2:G$7,G$2:G$7&""))+1
To get the position of Students.
But the text value "fail" in the G2:G7 getting Position No. 1 and i've noticed the reason by using evaluate formula as well.
3. I got solution by changing "Fail" with 0 by creating column I and then column H put this formula ........
View 14 Replies
View Related
Jul 6, 2009
I want to get students positions in a class like 1st, 2nd, 3rd, etc. There can be two 1st position and 2 2nd positions at a time .
1.In G Column I put logic for Fail and Obtained Marks.
G2=IF(COUNTIF(B2:F2,">=60")=5,SUM(B2:F2),"Fail")
2. Then i made array formula in column H to get the position
={SUMPRODUCT((IF(ISNUMBER($G$2:$G$7),$G$2:$G$7,0)>N(G2))/COUNTIF(G$2:G$7,G$2:G$7&""))+1}
Some improvement to write fail & position
={IF(COUNTIF(B3:F3,">=60")5,"Fail",SUMPRODUCT((IF(ISNUMBER($G$2:$G$7),$G$2:$G$7,0)>N(G3))/COUNTIF(G$2:G$7,G$2:G$7&""))+1)}
And more work to get total marks & position and Fail at the same time......
={IF(COUNTIF(B2:F2,">=60")5,"Fail",SUM(B2:F2)&"-"&SUMPRODUCT((IF(ISNUMBER($G$2:$G$7),$G$2:$G$7,0)>N(G2))/COUNTIF(G$2:G$7,G$2:G$7&""))+1)}
Now I wounder that is there a way to do all calculations in column H without using column G
By replacing (if there is any method) G2, G3, G4 etc. with Sum(B2:F2); Sum(B3:F3);Sum(B4:F4) etc. in below formula
={SUMPRODUCT((IF(ISNUMBER($G$2:$G$7),$G$2:$G$7,0)>N(G2))/COUNTIF(G$2:G$7,G$2:G$7&""))+1}.....................
View 9 Replies
View Related
Jan 28, 2014
At the moment I have to click in the cell and then look at the cells used and look across to the title of the rows.
So for example, performance = D3*D4*D5*D6
I would like, performance = vehicles*availabliity*utilisation*TKM.
That is easy if I have just 1 option. But what if I have 3 options? Naming each cell would be a way to do it but pretty laborious, is there a 'smart' way to use named ranges here?
View 3 Replies
View Related
Feb 12, 2010
I'm creating a KPI spreadsheet which utilizes named ranges to allow for Dynamic charting. I've created the first data input sheet for one of the 10 areas being KPIed. The sheet has 60 named ranges in it.
The goal is to duplicate the existing sheet (Area 1A) 10 times and adjust the named ranges and formulas within the named ranges according to the sheet names.
Is there a way to accomplish this without having to manually recreate or edit every named range for each new sheet?
View 6 Replies
View Related
Jun 16, 2014
I want a sumIF function (based on three criteria) to fill the values of cells in a column so long as there are values in the cells in the column before that one. I was working with trying a loop, but have been shown a faster way is using the With function.
There are four named ranges that all exist on a separate sheet in the file: Crude, Location, Year and Volume. Based on the first three columns of the file I wish to have an output for the sum of volume based on crude, location and year.
Right now, my output simply returns the total sum of the "volume" range in each cell in the output column.
For example, if total sum of values in the volume column is 100 then my output column currently looks like:
100
100
100
100
etc...
Here is my code including the named ranges:
[Code] ......
View 2 Replies
View Related
Jun 20, 2014
I created a simply macro that will adjust the headings of a group of cells as follows.
But if I add a row/column to the sheet, it will then of course attempt to place the headings in the wrong cells.
I have now given that group of cells/range a Name of "AR_Buckets". But I'm not certain how to modify the macro to ensure it always places the information in the correct place.
[Code] ....
View 1 Replies
View Related
Nov 24, 2008
What is the correct syntax if I want to replace two named ranges below to Rng and Rng2 in my code?
View 5 Replies
View Related
Jan 14, 2009
I am having problems getting the code below to follow my intentions. I have 2 files. I have a temporary file that holds all the data that I need. I have a destination file that needs to have data copied into it. In the temp file, I have data for several dates and product types. What I intend to do is to do a vlookup in VBA to look for the date and the product type in the temp file and copy the appropriate data to the destination file. I have numerous named ranges both in my temp file and my destination file. For the code below, I wanted to make a loop to find the date in the temp file that is listed in the destination file. Once this is done, I wanted to find the product type in the temp file that is listed in the destination file. If both conditions exist, then copy a certain range from the temp file to the destination file. My intention is evident in the code, but I don’t think that I am putting in the correct “code format”.
View 9 Replies
View Related
Feb 24, 2009
Macro for two named ranges. I have this code, which works fine...
View 4 Replies
View Related
Apr 29, 2009
(Using Office 2003 on XP Pro) I have two named ranges that I want to union into one big named range so that I can use the big named range in a validation table. Unfortunately the big range does not appear on the list of named range so I switched to VBA to try and lick this but really I was hoping a non-VBA solution exists. Exploring possible VBA solutions, here is what I have so far:
View 6 Replies
View Related
Jul 10, 2009
I'm trying to make my worksheet generate a bunch of named ranges whenever it is activated. However, I'm getting a "Not a valid name" error on the line in red. The value of r is a string, so I really don't see what the issue is. Another time, I got a object defined error, but I think I've declared everyhing too. That line is very similar to the line above, and tends to work once (the first time around the loop). After that, I get the errors I mentioned.
View 4 Replies
View Related
Aug 13, 2009
I have two named ranges, LV1 and LV2 and wish to select them for printing. If the ranges were fixed I would use - Range("A2:H4,A8:H10").Select - how do I do the equivalent using the named ranges in vba?
View 2 Replies
View Related
Aug 25, 2009
The worksheet contains 20 different datasets which are divided into separate 30 x 10 grids, all of which help comprise a larger 300 x 20 grid. I have defined each smaller grid/dataset as its own named range. Originally the entire dataset started in A1, but I am shifting it dataset down by 40 lines to create space to work at the top of my workbook.
I am wanting to create a data validation list in A1, then have cells A3:J32 populate with the named range I select in A1. However I also want this populated dataset at the top of the sheet to be a mirror -- not a copy.
Therefore once I have the data in my range available A3:J32, anything I manipulate would be mirrored in the original range in the lower portion of the workbook.
View 4 Replies
View Related
Dec 29, 2009
I am importing an external Sheet into my Excel workbook but it only imports the data not the named ranges. I need the named ranges to be imported and overwrite any existing range of same name.
Example:
In existing workbook Sheet I have a named range, ABC which is A1:E10 - in the Sheet I am importing the ABC range is A1:E12. So when I have done import I want named range ABC in my workbook to become A1:E12 (as per external Sheet).
This is the code that import data (but not named ranges)
View 11 Replies
View Related
Nov 10, 2008
can I merge 2 named ranges with a build-in function and give this merged range a 3rd name ?
View 4 Replies
View Related