2 Input Vertical Ranges Need Formulas To Output 2 Vertical Summary Ranges
Mar 7, 2013
I have two vertical ranges that I need summarized into 2 adjacent vertical ranges.
"
A B C D
| SUMMARY
model qty| modelqty
1 4.12922.0000| 4.12952.2000
2 2.000012.1250| 2.000025.1250
3 4.12929.0000| 318.0000
4 318.0000|
5 4.1291.2000|
6 213.0000|
"
A1:A6 is my SKU's model number B1:B6 is my inventory C1:C6 should contain formulas that result in a summary of the models D1:D6 should contain formulas that result in a sum of the inventory count for each model
I want to pass an array to a function, and am unclear how to do it. For example, the following declaration does not work:
Public Function xyz(a() as Variant) as Double
There is an additional requirement that I would like the output also to be a range of the same dimensions, typically one column and 100 rows. Is this possible?
A further twist is that the function I am writing calculates two values for every element in the input array and I need the output of them both.
An inelegant solution would be to write two separate functions, but I was wondering if it is possible to get two array outputs from a single function.
how do you create a graph with a field such as vendors on the X-axis, but with dollar values spent on the left side of the y-axis and percentage of total dollars spent on the right side vertical axis?
I am designing a from with a variable number of titles. The user should be able to insert a title into a column by typing in the title that he wants into a text box, and pressing a command button that I have created ( named add). The problem arises when I try to get the text to lie vertically as opposed to horizontally (in the cell, not as a text box. If this can only be done as a textbox, let me know). Is there any way to do this?
I have looked all over the place but nothing seems to work for me. In detail, I have a quote book i made with two sheets for different types of items on them. For example:
Sheet 1 is for wooden items, and sheet 2 is for metal items. So after i enter all the items on sheet one and sheet two, I want to be able to combine all the items from both sheets into one summary sheet that i can send to the customer.
I tried consolidate, and messed around with pivot tabels but it didnt seem to be what i'm looking for.
for example i have two work books where i need to compare the times, such as i need to see where does 10:26 am lies and after comparing it on workbook2 we need to return the data in a,b,c blocks infornt of 10:26am, i have tried IF(AND()) but i was not able to rationalise it for huge and random data.
Outout should be: 7/13/2013 10:26 a bc 7/13/2013 10:58 a bc 7/13/2013 12:06g hi 7/13/2013 12:17g hi 7/13/2013 12:29g hi 7/13/2013 12:29g h i 7/13/2013 12:37ghi 7/13/2013 13:21ghi 7/13/2013 14:24ghi
I need the correct syntax to consolidate ranges from several worksheets into a summary worksheet - all in the same workbook. I am building the Array on the fly, and I keep getting errors. (Subscript out of range being the most recent).
The code now is opening only one workbook so I can keep it simple. It iterates through the sheets collection, and builds the array.
Private Sub cbConsolidateToRollups_Click() Dim MyArray() As Variant Dim Source As Variant Dim SheetNames As Variant Dim SingleQuote, DoubleQuote SingleQuote = Chr(39) DoubleQuote = Chr(34) 'set the directory to Rollups ToPath = Application.DefaultFilePath & "Cost Tracking" & "Rollups" ChDir ToPath ....................
I need a 'simple' vba that outputs all the dates in a range that correspond to a particular ID in a column as well as that same ID in a column beside the dates.
So basically using the data in columns A to B as input, to get columns E and F as output.
basically I am trying to total this spreadsheet up to work out a sum for the month by customer number. some customers made a payment in jan 2012 and paid again in jan 2013, some paid twice in one month.
what needs to happen is
it needs to have customer number going down and the month/year going across the top with a summary paid for that month
Using MS Query in Excel, I've created a simple query that pulls its records from an SQL dbase. Here's the statement:
SELECT uvVisit.FacilityListName, uvVisit.DoctorListName, uvVisit.Date, uvVisit.PatientVisitId, uvVisit.PatientLast, uvVisit.PatientFirst FROM CPS.dbo.uvVisit uvVisit WHERE (uvVisit.Date Between ? And ?) ORDER BY uvVisit.FacilityListName
The query runs fine and prompts the user to enter beginning & ending date ranges for the visit date when executed. So far...so good...but, this requires me to manually insert a line in Excel above the 1st record and type in something like: "For Date Range: MM/DD/YYY - MM/DD/YY" to denote the date range that the qualified records fall into (something the user wants to see).
However, I'd like to find a way automatically preface and display in the report's output (perhaps as the 1st line of the report in Excel??) something similar to what I'm already typing, and have it pull the beginning and ending MM/DD/YY values from those supplied by the user in the parameter.
I'm working on a project whereby ranges of values are "scored".
The current layout shows ranges of within cells, and a hidden row with single values for the formulas to utilize. This means that whenever ranges are adjusted, the singles values also have to be changed.
I've attached a portion of the spreadsheet as an example.
Is there a relatively simple way to have the formula recognize the ranges as values and "score" accordingly?
If there is, can this be used for both ascending and descending ranges?
I should add that the ranges are not always percentages.
I am trying to combine three IF formulas that depend on ranges that vary. I think the attached sheet does a much better job of explaining what I am looking for than I can do.
I am having trouble entering a formula that measures how many times "Open" occurs in one column IF another column's entry is between 2 dates or within one particular month time frame. I've tried a bunch of formulas but can't seem to get anything to work!
I would like to add another step that pastes the formulas copied from the active sheet, to specific ranges of cells.
I would like the PasteSpecial XlFormats to apply to all cells on the active sheet, where as the PasteSpecial xlValues would only apply to all cells not in the ranges that the Formulas are getting pasted into.
Also for formatting purposes I have a few cells that are merged in the active spreadsheet, that unmerge when I run the macro. Ideally I would like any previously merged cells to stay merged once the macro is run.
Below is the VB I have...
VB:
Sub SaveSheet() ActiveSheet.Copy With ActiveSheet.UsedRange .Copy .PasteSpecial xlValues .PasteSpecial xlFormats
i have an excel sheet with two columns, and depending on the status of the equipment, i need to compare the two columns and if the data is the same, fine, otherwise i need to display a msg box with an error. the columns have formulas in them, and i assigned a name to the cells i want to check, i keep getting errors with the following code, when the colums are the same, it is still displaying the msg box with the error. what am i doing wrong?
For Each Row In Range("Dev_Found") 'Loop through each row in Column C If Row.Value ActiveWorkbook.Names.Item("Dev_Left").Value Then blah = MsgBox("Your % Dev for after does not match % Dev before, please correct on form!", vbOKOnly, "Error") Exit For End If Next Row
I am wanting to build a macro to calculate the average of a range of cells. I have about 2000 lines of data, and I want to average the first 12 cells (then paste the answer somewhere else), then average the next 12 cells, and so on. Using a loop to do this is simple enough. My problem is that I can't insert variables into the average formula as the cells to be averaged
Sub AutoAverage() For x = 0 To 20 For y = 0 To 171 FirstRowRef = Workbooks("NP FT01-03 010206.xls"). Sheets("NP - FT01") _ .Range("a5").Offset(12 * y, 12 * x) LastRowRef = Workbooks("NP FT01-03 010206.xls").Sheets("NP - FT01") _ .Range("a16").Offset(12 * y, 12 * x) Workbooks("Mega Spectrums.xls").Sheets("NP - FT01").Range("a5").Offset(y, x).Select ActiveCell.FormulaR1C1 = "=AVERAGE(FirstRowRef:LastRowRef)" Next y Next x End Sub
I have been handed a workbook which has been used and amended by a number of people over about 5 years. The workbook has lots of named ranges, many of which are obviously now defunct. Others may be defunct but I'm not sure. I would like to delete all of the defunct ones.
Does anyone know a way in which I can identify the cells in which a named range is currently being used?
I would like to set up VBA codes to generate a variable number of transition matrices. I would like to know how I can define dynamic ranges instead of coding each and every range. In the codes below, I have to define each range one by one instead of using a loop.
Sub TransitionMatrix() Dim P1 As Range Set P1 = Cells(2, 2).Resize(3, 3) Dim P2 As Range Set P2 = P1.Offset(5, 0).Resize(3, 3) P2.Cells(0, 1) = "P2" For i = 1 To 3 For j = 1 To 3 P2.FormulaArray = "=MMULT(" & P1.Address & "," & P1.Address & ")" P2.BorderAround Weight:=xlMedium Next j Next i Dim P3 As Range Set P3 = P2.Offset(5, 0).Resize(3, 3)........................
I have a Formula = SUMIF('Master List'!B3:B190,AE197,'Master List'!AG3:AG190) When I copy this formula the next line is as Follows =SUMIF('Master List'!B4:B191,AE197,'Master List'!AG4:AG191) Is there something I can do to in order to make so that when I copy the formula is would read =SUMIF('Master List'!B3:B190,AE198,'Master List'!AG3:AG190). Elliott Auto Merged Post;Nevermind I used the formula = SUMIF('Master List'!$B$3:$B$190,AE197,'Master List'!$AG$3:$AG$190)
I need to run a formula each month which calculates the ‘product’ for a range of cells in a column, where the cell range will change each month. The starting cell for the range is static, but the range end will always change - additionally, the last valid cell will always be followed by a null value cell. The attached example shows the basic format of my data – a range of values, by row, which will always end with a null value cell. The formula I’m using (to match my example) is: =(PRODUCT(A10:A13) –-> and I want to display the result in cell C10.
While I’ve been able to identify the ‘ending good row’ several ways, I haven’t been able to figure out what to do with this information – I seem be be lost in the translation of OFFSET values to CELL REFERENCE values. Has anyone encountered this specific scenario and found a solution?
I basically need to switch between ranges of cells to data input alot. so i thought of making a fixed field to enter the data which transfers the data over to designated cells .
Attached is an example.
I am not too sure which one will work, the If statement captures the data but when i switch out , the entry is gone .
cubspline(Xval As Double, XRange As range, YRange As Range) As Double
The problem is that XRange (and also YRange) is in different areas of the spreadsheet. I want to combine these areas into one range which I can pass on to the cubspline function. What is the easiest way of doing it? I'm looking for something like a "union" function for ranges in Excel.
I have a workbook with several sheets and named ranges like ES_Date, ES_Range, ES_Volume or MC_Date, MC_Range, MC_Volume. The 1st two letters are the name of the sheet where the named ranges are located (one is dates, another volume, etc.).
What I'm trying to do is calculate averages, extract maximum and minimum values from the the named ranges using a start and end date that are entered in cells "H6" and "I6". The formula I am using right now is:
I need help creating a macro that will search through my excel spreadsheet and for every instance where column A isn't empty it should cut a range of columns from that row and paste them in a different range of columns in the row before it. It should then delete the row that it cut the columns from and keep searching until it has done this for the whole worksheet. I can modify which range of columns are needed, but it has been so long since I've worked with excel macros that I haven't been able to do it.
I need to select in a sheet the cells which have name reference to see if the whole sheet is dependent , i have tried to trace the dependents and precedents but that didnt work,
Trying to build a form that helps assemble parts a pieces based on filling out just a small section of information. Here just a short example:
Tower Type: Type 1 Coax Length: 100 ft
Based on the above criteria, I am going to have a line item that auto fills specific parts and pieces based on the answer. The main problem I have is the coax length answer will fit within several ranges and I need a cell to be able to identify and autofill ALL of those ranges.
Specifically, if the coax length is between 0 and 100, I need to autofill the below cell with Coax 1, from 101 to 200 Coax 2, and so on and so forth. Lets say I have 5 ranges of "greater than, less than" values. how do I make a formula that will consider all of these in a VLOOKUP scenario?
If I haven't asked the right questions, or phrased them incorrectly, please let me know....I'm not the most excel experienced person...hence my visit to this forum!