How To Create Block Matrix
Feb 12, 2013
I'm struggling to find the right Excel functions to fill up a block matrix. Here are all the details of my problem.
I have a list of firms and relative products. Each firm can produce either 1, or 2 or 3 different products, for instance
firm A produces product x
firm B produces products y and z
firm C produces product j
firm D produces products k, h and q
Suppose the data appear on a sheet in column order, that is, one column for the firms and one for the products with a space between A, B, C and D when one firm is a multi-product producer. I need to create a 0-1 block matrix in Excel setting 1 when the product is produced by the same firm and 0 otherwise, i.e. for the above example
x y z j k h q
------------
1 0 0 0 0 0 0
0 1 1 0 0 0 0
0 1 1 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 1 1 1
0 0 0 0 1 1 1
0 0 0 0 1 1 1
I can do this in VBA but not in Excel, and unfortunately I need to provide an Excel solution.
View 3 Replies
ADVERTISEMENT
Apr 29, 2013
Below there are all the information needed to understand my problem.
M(1 to R,1 to C): matrix with R rows and C columns [element known]
M(i,j): elements of the matrix M in position i(row)-j(column) [element known]n
View 3 Replies
View Related
Jul 12, 2012
I have a quite big database as a result of a study in Excel 2010. There is a special block of data for every participant in the study, including 16 data series in 16 lines. I have to make a unique chart for every line.
One block is bulid up in a way, that every row is the input for a chart, with the exception of one "spacer" row, which is empty.
Name
1 2 3 4 ...
A
B
C
D
E
F
For example in the sample above, there should be 6 line-charts (A, B, C, D, E, F) next to the block.
Can a macro be written, so I can automatically create the chart-set by selecting the block's upper left cell and running the macro? Or is there any easier method?
View 5 Replies
View Related
May 1, 2014
I'm trying to create a risk matrix like the attached example. I want to be able to enter a value and to have it to appear in the right quadrant.
View 2 Replies
View Related
Jan 30, 2013
I have 2 types of data: Product & Store
And the data would go like this:
A
Corn Flakes
Frosted Flakes
Froot Loops
B
Store 1
Store 2
Store 3
Store 4
The number of entries of course is a lot bigger, that's why I'm trying to make it auto.
So what I need is to have a table created that would mix both data type in 2 columns, like this:
Product
Store
Corn Flakes
Store 1
[Code]...
How would this be done automatically by a formula?
View 9 Replies
View Related
Dec 26, 2013
I have a Table of multiple values. From this table, I need to lookup and match the corresponding value in another table, and return a "X" if the looked up values match.
For example: The table with the data in it is:
Apple
Bob
Candy
Bob
Cookie
Bob
Donut
Bob
Figs
Bob
The Table I need to create is: As follows: It will have Bob in the Top column, and the rows to the left of Bob will say, Apple, Asparagus, Candy, Cookie, Dancing, Donut, Fame, Figs, Zebra. I need to read the top table and populate with an "X" the values which have Bob.
View 9 Replies
View Related
Aug 21, 2008
i have many tables for many carriers with the same format, and i need to create a unified table of them, the tables look like this
-------A---------------------B-----------------------C---------
----Destination----------Country_Code-----------Price_Per_Minute
1------UK-------------------4479-------------------0.256-----
2------USA------------------1148------------------0.300------
3------Jordan----------------9626------------------0.899------
4------India------------------9198------------------0.345------
so let us consider that these are the prices for X company and i have another ten tables for other 10 companies, what i need to do is to create a unified table that includes all the companies prices for all the destination depending on the Country_Code as it could be considered as a primary Key and without any duplications and to include the all the data in all the tables as some destinations and prices are not available in all the tables, so the tables contains different data, the unified table should look something like this
-------A----------------B----------------C------------D---------E------
----Destination-------Country_Code-----X Price-----Y Price----Z Price----
1------UK-----------------4479-----------0.256-----0.254------0.356----
2------USA---------------1148------------0.300-----0.876------ ---
3------Jordan-------------9626-----------0.899------0.987------0.324---
4------India---------------9198-----------0.345----- -------0.564--
View 6 Replies
View Related
Jun 19, 2014
I have a set of exported data from a Project Management SW (activecollab). The result is an excel .xslx file with a table inside with a lot of cells I am not going to use. Additionally, what I would like to do is creating new tables on other sheets that use only the data I want from the export. For example, I have two projects and three employees. I want to create three tables with the names of the three employees. In each table I want the tasks done by them and the time they will spend on them in order to create a Gantt chart. I need a solution that allows me to create new tables with selected data from a bigger cluster (the export). you do not need to give me the exact solution, I only need to know whether it is possible or not and where could I get the info to do what I want.
View 1 Replies
View Related
Aug 26, 2007
I have a data chart on 200 people with overlapping membership in 20+ groups, represeted as binary (1=member, 0=notmember), for example: ...
View 9 Replies
View Related
Aug 22, 2008
Using VBA, I wish to work out the inverse matrix of a large matrix (100*100), but keep getting the # Num! Error. I am using the minverse function. I have defined variable as "variant", does this give me the same possiblities in terms of number size as the variable "Double"?
View 9 Replies
View Related
May 23, 2009
I've searched the forum and believe this thread to be the closest to what im looking for, but its doesnt completely apply: matrix to list conversion. I have an attachment to support my questions (see attached). I have a matrix of words (strings) that contain repeating and non-repeating contents. The matrix also has spaces which are of no value. Essentially, the VBA needs to ' analyze' this matrix and create a consolidated frequency list (as shown in the file).
The matrices are HUGE and therefore some of the clumsy VBA i am using is turning out to be a bit inefficient. The file also contains formulas and such that I cannot use AutoFilter nor can I use Insert or Delete rows...so the VBA shouldnt use those either.
View 6 Replies
View Related
Mar 21, 2014
For a table like the one below produced for the sake of example (actual is much much bigger) I want to make it list rows that are true for a certain column for a certain variable in the matrix. So for say water terrain, which types of activity can I do i.e. swimming. Or for Offroad the activites which I can't do i.e. Run and Swim.
ActivityWaterRoadOffroad
Jog nym
Run nyn
Walk nyy
Swim ynn
y=yes
n=no
m=maybe
View 10 Replies
View Related
Oct 29, 2008
I have made this simple code which replaces an empty cell with "Empty" on a button.
View 4 Replies
View Related
Apr 2, 2014
I'm using combobox to display set of data. When you choose value from ComboBox (lets say "Audi"), below on the sheet you will get all information about audi in rows:
year....
color....
dors... etc
I know that somehow the ComboBox can be unfortunatly deleted or moved etc. What else I can use to replace ComboBox?
It's option "Data Validation", but I don't know how to there assing macro. I can create button and assing to him, but its other way?
View 1 Replies
View Related
Apr 13, 2009
I have been out or writing code for a long time and my experience prior to that is very limited.
Rows "H" and "I" may contain the same words, "H" will be only one word, "I" will contain a string of words w/ the first word matching the word in "H", eg.
H6 = "Alien" (w/out "")
I6 = "Alien W. A.V.E (w/out "")
I would like to put a block of code that evaluates H6 to I6 and if they match then delete the first word and the space in I6.
This would be done over the range of H6:I and the last cell populated in "I".
View 9 Replies
View Related
Jun 15, 2009
I'm new to VBA and I'm trying to creat an If block.
If "named range" is TRUE then....
Could someone quickly tell me the syntax for this.
The range is actually on a different sheet than I am working on, but the named range is global.
In my case my named range is "WBSCheck" and it is a logical/text value of True or False.
View 9 Replies
View Related
Jan 23, 2010
This supposed to block Alt key and all combinations with it except Alt+F1, Alt+Tab and Alt+Shift. But what I get is: if I press Alt+F1 only, F1 is triggered.
Private Function LowLevelKeyboardProc(ByVal nCode As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Static kbdllhs As KBDLLHOOKSTRUCT
If nCode = HC_ACTION Then
Call CopyMemory(kbdllhs, ByVal lParam, Len(kbdllhs))
If CBool(kbdllhs.flags And LLKHF_ALTDOWN) Then
Select Case kbdllhs.vkCode
Case vbKeyF1, VK_LSHIFT, VK_TAB
Case Else
LowLevelKeyboardProc = 1
Exit Function
End Select
End If
End If
LowLevelKeyboardProc = CallNextHookEx(m_hDllKbdHook, nCode, wParam, lParam)
End Function
View 9 Replies
View Related
Jul 23, 2012
I have a column of numbers of approx 3000 rows and the number is either a 0 or 1 and they are in a random order in each row. I would like to count the number of 0 in the column. If there is consecutive 0 (a block of 0), I would still need to count it as a single occurrence.
For example, the count (or sum) for the number of occurrences for the number 0 in the below would be 4.
0
1
1
0
View 3 Replies
View Related
Jun 16, 2009
I need is for a block of cells (A1:I4) to be visible at all times. I've frozen the sheet so that the top four rows are always visible, but unfortunately the sheet is quite large, horizontally-speaking, so that when users scroll horizontally, important stuff scrolls off the screen.
View 9 Replies
View Related
Feb 19, 2014
I have a sheet with data and in column A there is the month. Now each month the macro adds new data for the new month.
What I want now is that i can load the same month twice. But of course when I do that first the old month has to be deleted from the rows. I already build a check that first looks if the month is already in.
So when it is already in it should find first row and last row with that month and then delete al these. Then when it is deleted the macro can continiou with pasting in the new month data.
But letting it check row by row and deleting row by row is no option! Its a long list and I aready tried that, it is just verry slow that way.
ps: all the month data is grouped as month. So no other month lines are in that block of data.
View 2 Replies
View Related
Oct 16, 2008
I have a named block, used to sort a list of data. But I names the block one row higher to include the headers, so that inserts at the top row of the data would not fall out of the named range. Then I want to sort the data, but not include the header row.
What I want to say in the sort macro is something like:
cell_range( top_row(Data)-1, Bottom_Row(Data) )
Or, to have two names, with one defined in terms of the other:
Data_sort = Data_big - Toprow(Data_big)
View 4 Replies
View Related
Apr 11, 2012
I have a database with dates in coloum F, coloums G to Q is where different product tonnages are entered. Cell Report C2 is the start date and cell C3 is the end date. I can calculate the total tonnage of a product (coloum J) bu using the formula
= Sum(Data!J:J)-Sumif(Data!F:F,""&Report!C3,Data!J:J)
This works but now if I want to total from coloum G through to coloum Q between the dates I cannot get it to work.
View 2 Replies
View Related
Jul 17, 2007
I am getting the error message
"Compile Error: End If without block If" for the code below :
ErrorHandlerRoutine:
If MyInteger = 1 Then
MsgBox "Data does not exist in the CO2 data set"
End If
Resume 1
If MyInteger = 2 Then
MsgBox "Data does not exist in the Water data set"
End If
Resume 2
If MyInteger = 3 Then GoTo 3
MsgBox "Data does not exist in the Waste data set"
End If
Resume 3
View 9 Replies
View Related
Mar 18, 2008
I have another question. When address come through our DB into Excel, they are in one big block. In other words the city and state and zip are in a lump with the street address. Text to columns does not work because it does not break up the text consistently. What can I do?
View 9 Replies
View Related
Mar 13, 2009
I'm trying to find cells in a range that have a date >= today.... this wont work:
Set Cell = .Find(What:=Cell.Value >= Date, After:=.Cells(1, 1), LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False)
Can it be adapted at all?
View 9 Replies
View Related
May 12, 2006
I have a log that information gets enter into by rows. When one rows info is entered a "Start" button is to be clicked and a macro runs and does different calculations. I want a way to not let the next rows information to be entered until the "Start" button is clicked on or Is there a way to have the code run automatically when the user has entered the info in the last cell of the row and goes back to the first cell in the next row ?
View 3 Replies
View Related
Sep 15, 2006
How do you block out the past dates?
Like today is september 14th, tomorrow I want september 15th to be highlighted but all dates previous to september 15th to be black.
Here is the code if it helps any one out. Thanks in advance for the help.
Sub CreateCalendar()
Dim lMonth As Long
Dim strMonth As String
Dim rStart As Range
Dim strAddress As String
Dim rCell As Range
Dim lDays As Long
Dim dDate As Date
'Add new sheet and format
Worksheets.Add
ActiveWindow.DisplayGridlines = False
With Cells
.ColumnWidth = 6#
.Font.Size = 8
End With
View 4 Replies
View Related
Jul 17, 2007
It seems like this error applies when it can't find something you're referring to, like an object variable. But I can manually find every variable in my code and can't see what I'm missing:
Public Sub InventoryFile()
Public InventoryWksht As Worksheet
Public CriteriaWksht As Worksheet
Public Criteria As Range
Public InventoryRange As Range
Public Sheeti As Worksheet
With Workbooks.Open("MyFile.xls")
Set InventoryWkbk = ActiveWorkbook
Set InventoryWksht = InventoryWkbk.Sheets(1)
End With
With InventoryWksht.Cells(1, 1). CurrentRegion.Name = "Inventory"
Set InventoryRange = InventoryWksht.Range("Inventory")
End With
Worksheets.Add
ActiveSheet.Name = "Criteria"
With CriteriaWksht
Set CriteriaWksht = ActiveSheet
CriteriaWksht.Range("A1:B2").Name = "Criteria"
Set Criteria = CriteriaWksht.Range("Criteria")
Criteria.Cells(1, 1).Value = "Value"
Criteria.Cells(1, 2).Value = "Location"
End With
End Sub ...
View 7 Replies
View Related
Apr 30, 2014
I'm trying to set up a water bill calculator and am having troubles. We have a base rate that we charge for everything under 4000 gals. After that we have an increasing tiered rate. I'm trying to make a form so we can calculate bills accordingly. I don't know how to create an "IF" scenario.
example
If "total usage" is greater than 4001 but less that 8000 multiply by $4.50 per 1000 gal
If "total usage" is greater than 8001 but less that 12000 multiply by $4.75 per 1000 gal
If "total usage" is greater than 12001 but less that 16000 multiply by $5.25 per 1000 gal
If "total usage" is greater than 16001 but less that 20000 multiply by $5.50 per 1000 gal
If "total usage" is greater than 20001 and over multiply by $5.75 per 1000 gal
Is there an easy way to do this?
View 8 Replies
View Related
Jul 15, 2014
developing a formula that will apply data from one cell to a block of text in another.
Here is what I need to do.
1. I want to insert the data in A1 of the attachment to the block of text in B1.
I can do this manually but I have to do this 10,000 times so I need a formula that I can apply.
View 8 Replies
View Related