Randomize 0 And 1 Values In Array In Order To Get Specific Sum By Column And Row
May 8, 2013
I have a table like the one below, only it has a few hundreds of rows and columns and I need a solution in order to fill in the blank spaces with 0 and 1 in order to get the total by row and by column. Is there any way to do this with a formula/macro ?
I am trying to select specific values within an array.I have two tables, weight table and a factor table. These tables are a lot bigger than the example. I am trying to multiple the weights times the corresponding factors and then sum the result in one cell using arrays.
The third table is the result I am looking for. However, I would like to use some type of index/match or choose to get the result but cannot figure out how to do it. A couple of functions that I tried that did not work are next to it.
The index fails because the index function does not output an array (The result of the index function is just 4% instead of {4%,3%,4%}). The choose fails because the choose function does not select values within an array (ie I would have to put each factor as a separate value (F4,G4,H4) rather than the entire array (F4:H4). There are so many factors that I would like to avoid that.)
Sheet3
ABCDEFGH1 2 3NameWeightFactor DateFactor1Factor2Factor34Name125%Factor3 7/1/20105%3%4%5Name235%Factor2 8/1/20107%2%3%6Name240%Factor3 7 8DateReturn Does not work 97/1/20101.04% 4.00%#VALUE! 108/1/20102.65% 3.00%#VALUE!
[Code] .......
Array: Produce enclosing { } by entering formula with CTRL+SHIFT+ENTER!
Can I reverse the order of values in a column or row? [ie] first cell goes to last cell, last cell goes to first cell, middle cell stays where it is, etc. [and if so, how?].
How do I transpose the values in a column of cells (so the value in the topmost cell in the old column becomes the value in the bottommost cell in a new column)?
Ok, imagine this data (say column A). I want to have a cell that automatically searches for the least value (will always be the first number from top) and returns it in another cell. And then repeat the same for the second number from the top.
Trying to arrange numerical values in order from lowest to highest in a column i have a code to do that but i need it to be able to but to a range in the column so it only sorts the values in rows 3 - 60 not all of the rows in the column
Sub Testsort() Range("A3").CurrentRegion.Select Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End Sub
I've been writing a UserForm in Excel that serves the purpose of a front-end contact/reporting spreadsheet.
I've managed to get a multitude of elements to work together as of yet, however have been having problems writing data to the correct place on the spreadsheet.
What I've already achieved:
The first interactive portion of the userform currently has a TextBox (ArtistAgentAddEmail) - this is the email that we would like inputting on the spreadsheet.
a ComboBox which is populated on 'Userform_Initialize' into an array (ArtistAgentAddDestination) - The range of this array is A1:AC1.
[Code]......
What I would like to do next:
The issue that I've been having is getting the email to be written into the correct column. Once I have typed in my email and chosen my destination from the combobox, I would like to write this email address in the column of the destination chosen.
E.G. The first 5 elements of my ComboBox array are: Neil O'Brien, CAA, CODA, ITB and PRIMARY. If i got an email from somebody in the CAA organisation to add a new contact to the reporting, I would like to be able to add this address via the userform underneath the previously added contact.
The code that I am currently using for my confirm button is:
Hi, I'm very new to writing Excel Macro's and wanted to know if I could do the following. Conceptually, I understand what I need done and think it should be fairly straightforward.
There's 2 main events in this loop (I hope that's the correct terminology):
Input 1) User defines the beginning cell to start the loop. In this case, A2.
Input 2) User defines the range of columns/rows to display. The formula for rows that I've thought of is 4r. So if a user wants 20 rows below cells A2, they simply input 5 for r. The number of columns is a constant 5. So if r=5, then I'd want the range to be A2:E22......
I need a way to re-order an excel worksheets columns based on another worksheet.
Data is extracted from a database into excel however users can configure the columns in the initial system. to how they like This causes problems when the data is copied into an excel spreadsheet I have created as the data copied will not be in the same column order as is required.
How can i reorder the columns without physically having to cut and paste the columns to match?
I have attached a sample spreadsheet.
You will see on the spreadsheet that 'fixed columns' is the order that i require the data however 'variable columns' is not in the same order.
Ok I'm writing an extraction formula. I've got my array of Trues and Falses, but now I need to go through each row and check if all the columns are TRUE, and then return the row if all the columns are true.
Right now I'm just working with a dummy set of data... my real table is some 50 columns wide and over 300 rows, but this gives you the idea of what I'm doing:
I tried putting in a Countif and using it like and array to count the different rows and return the number of times each row was returned... but countif goes nuts when you try an array for the criteria.
I need to capture a list of unique usernames appearing in a column on the sheet, and also the number of times each user has a desired value occur for their row (an error). The number of users and the names of the users will change from one sheet to the next making a static solution unworkable. The user names will be unsorted in the column.
My first reflex is to use an array, and an associative array if possible would allow me to reference the user by name, instead of a clumsier index number and iterating through a loop to verify if the user is already stored in the array. I don't know if it's possible in VBS though. I'll add any new users names to this array if they aren't already in there.
I Need to loop through col W Used range except the last row which is totals or the first 4 rows which is Heading stuff, and if value > 0 post it to a column on the right based on the day code. ( 31 values 1 for each day)
This is for a race track. Drivers sign in on one sheet. On that sheet there is 4 different columns. Column 1 lists the division that they race in. Column 2 is the name of the driver. Column 3 is his car #. Column 4 is the number that he draws that decides his starting position. Typically there is 2 heat races per division with the odd number that is drawn being in the first heat and the even number being in the second heat. I created a second sheet called heat races. I am using an index function with a small function with a row. I have my divisions listed separately with 2 heats per division. I want to display the car number per division but lined up by the position that they draw. I have figured out how to display all of the cars per division, but I can't figure out how to separate them by what they draw (odd and even and in order from lowest to highest).
This looks up if Player 1 was in the top 3 scoring zones and adds up the players total score.
I have another column in this table of data labelled 'Number of Players'. I was wondering how to lookup the total score for this player in the games he played under 6 players for example and the games he played in where there were other six players.
I've tried using that formula ^^ with variations of IF and SUMIF formulas to try and figure it out, but I keep getting formula errors or it just returns with the total score, and not just with the total score under 6 players.
I am also trying to create a graph of date on the x axis against score to date on the y axis - everytime I try, the x axis is always numbers instead of the date?
I want to find a macro that will auto filter on for example "Banana" would filter to rows 4,5 "Orange" would filter to rows 1,2,5 "Apple" would filter to rows 1,3
Any way to search for a value down column A, another value across roW 1, and tells what value lies in the cell at their meeting point. 4 example, I'm looking For "47" somewhere in column a, and also the number 53 somewhere in row 1, and I need to know what value is in the cell where those to meet.
I'm attempting to write a macro that will select all the rows which contain a value in a specific column. Say for example, all the instances of "test" in column C, I need to select the entire row with that value in the column.
I should also mention that by using an autofilter, only specific row numbers are selected. The source spreadsheet is dynamic and will not always display the same value in the same row, and thus I need something a little more adaptable.
I need to calculate a Sums of Products with unusual requirements. Please refer to the attached picture. The Orange Cells under "Noise Weight" are the Formula Cells. The Values in those Cells need to evaluate as shown in the equations below. I want this to be dynamic, so that if I expand the FM Region (Add Columns between "Noise Weight" and "FM15") AND expand the Severity Region (Add Rows between Severity and Noise Weight), I will not have to update Formulas manually. I know for sure that the standard SUMPRODUCT Function cannot handle this.
I am in desperate need of a function that will count a column of data where there are blanks and values based on a certain date that will also capture any data that is added after refreshing the table from Access. I have tried several functions but this is what I have: =(ROWS('TouchBack Detail'!$Q:$Q)*COLUMNS('TouchBack Detail'!$Q:$Q))+(COUNTIFS('TouchBack Detail'!$B:$B,'Nov TouchBack Summary'!B$1)). The result should be 3 but it’s including all other cells in the column that are not and should not be included in the refreshed table’s data (Table_TouchBack.accdb). I have attached the spreadsheet for review. The function is in cell B27 highlighted in yellow.
I have a list of terms to put together and what I have is a master list of 6 concatenate functions and I need to link them to all the different words in my list.
The first word in collumn A needs to be with the function in D1, the second word (A2) needs to be with D2, then A3 with D1, and A4 also with D1, while A5 with D6, etc. It looks something like this:
for your info...I have put numbers in the adjacent cell corresponding to which of the 6 concatenate functions need to go into the cell in collumn C
So in reality all I need is a function that would rearrange my list of 6 functions from Collumn D into collumn C based on the numbers 1-6 I have in collumn B
Workbook.txt
(attached is an example to better see what im talking about. Disregard that the concatenate functions are not working...it doesnt matter right now.)
I would like to sort my column A by "Urgent, High, Medium and Low". However, when I click on sort, it obviously sorts alphbetically. Need to code to sort all colums A:K.
I want to export some columns of my worksheet to a csv-file. But i don't want to export all of them, i just need for example: Columns B, D and G and inside the csv-file they should be in an different order like G, B, D .
I already thought about using "union" to select the specific columns, but i can't get this to work.
Sheet2  ABCDE1Data    2ABSCar1Car3Car6Car13ADFCar2Car5Car3Car24ANDCar1Car1Car1Car35ADXCar6Car6Car5Car1 6     7     8     9Results10   Car1Data11    ABS12    ABS13    AND14    AND15    AND16    ADX17     18    Data19   Car2ADF20    ADF21     22    Data23   Car3ABS24    ADF25    AND26     27    Data28   Car5ADF29    ADX