I'm trying to transfer values with macro in Excel for my upcoming billiards tournament playoff table. For example let's say I have column A with names {A1,A2,A3,A4} and every name is on a different row. Then I have column B in the same sheet with according values {1,4,3,2}. Now I have another sheet which has column I (and previous column H of course) and that column I has values from 1-16. I'd like to match numbers between columns I and B and place names to the previous column (column H).
To visualize this idea (keep in mind that every element is on its own row):
Column A, sheet #1: {A1,A2,A3,A4}
Column B, sheet #1: {1,4,3,2}
Column I, sheet #2: {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
Column H, sheet #2: {}
Column H should get values from column A, other rows (which numbers are not in column B) will be left empty.
I've never done VBA before. I know coding in Java and Python but VBA is not really my thing. I'd like to see if anyone could point me in the right direction or maybe should even solve this issue.
I think what you want, is:
Turn on Record Macro:
In H1 enter:
=IFERROR(INDEX('Sheet #1'!A:A,MATCH(I1,'Sheet #1'!B:B,0)),"")
and copy down to suit.
Related
I have an issue with using data from a source table:
Lets say we have Sheet 2, where in column A is the formula
=IF(Sheet1!A1 = 0;"";Sheet1!A1)
I am taking only the newest info form Sheet1 to keep another type of data in Sheet2 about the given value. In columns B,C & D in Sheet2 I have manually input data, relating to the result value from Column A.
The issue is that the information in Sheet1 needs to be kept chronologically, so if the last(newest) row is with an earlier date, Sheet1 needs to be sorted by date. This of course automatically sorts the values in column A of Sheet 2, based on the formula. However, all data in B, C & D is still based on the values, before the sort, as it is manually input.
Is there a way to move around the whole rows in Sheet2, based on the value in column A, when sorting Sheet1?
The only resolution I could think of is to paste the formula results as values, but the table would not be as dynamic anymore.
Thank you in advance!
This is probably a very simple formula.
I have an employee database that looks like this:
I want to make a list of everyone who was hired in January (for example) in another workbook.
So I need to scan column 7 (Employees[Hired on]) of the table, and have excel output the employee's name from column 2 (Employees[First Name]) to the other workbook.
I'm assuming I can use variations of this same formula to gather my other data.
You need an intermidate column, because Excel can't filter by "modified value" (as far as I knew).
So, my solution is:
insert column between column E and F. The old columns after column F will be shift right by 1 column (F -> G, G -> H, and so on).
input F8 with =MONTH(E8).
Copy F8's formula to below (I assume it is F26).
input with =COUNTIFS(Work!F8:F26, 1). Note that Work in the range should be replaced with your work sheet name.
Step 1 to 3 may be done on another sheet. You should qualify sheet name like step 4.
first of all, I don't know much about macros in Excel. I would really appreciate it, if someone could help me out here.
I have a 7000 row table with 3 columns. The first two columns contain string-values, the third integer. I need a function that summarizes my rows, if the same constellation of strings occurs. Example (each character stands for one column):
AB1
JK2
BA1
AB4
FH2
JK1
After running the script, the result should be:
AB5
JK3
BA1
FH2
How would that be possible? Thank you SO much! I need this for a university project in which we visualize weapon trades within military alliances.
Assumptions:
Your data is in Sheet1, in columns A, B and C
The data starts in Row 2
Your output data is in Sheet2
Without using VBA, you can do:
Create a helper column (e.g. column D), which combines Columns A and B. The formula (in D2) would be simply =$A2 & $B2
To create your output table, you copy the column D in Sheet1 and paste it into eg. column A of Sheet2.
Then you select the whole column A (Sheet2) and go to: Data > Data Tools > Remove Duplicates
In B2 then goes this formula: =Countif(Sheet1!D:D, $A2)
You can of course put the helper column somewhere else and hide it. Also, change Sheet1 etc to your actual names.
I have found VLOOKUP and it does not seem to match all of the criteria I need to perform.
The following is what has stopped me at this time. I would appreciate any assistance.
in excel, I need to match a value from a specific cell in spreadsheet A, column B, with a range of values in spreadsheet B, column C. Then in the row that the value in spreadsheet B is found, I need to obtain the value for the cell in column P and copy it into spreadsheet A column N.
Thank you,
While VLOOKUP has its uses I would always recommend using the INDEX function instead as you are not limited by using the leftmost column.
I think the type of formula you are looking for is (to be put in column N of spreadsheet A):
=INDEX('[Spreadsheet B]Sheet1'!P:P,MATCH(B1,'[Spreadsheet B]Sheet1'!C:C,0))
This would match the specific cell of B1 in Spreadsheet A with a value in column C in Spreadsheet B and then give provide the value in column P of the corresponding row. Obviously you should change out 'Spreadsheet B' with the name of your workbook and 'Sheet1' for the name of the worksheet in Spreadsheet B.
Would really appreciate some help. Pretty basic problem. In column A I have SSN's, Column B I also have SSN's and in column C I have dates associated with the SSN's in Column B. The problem the 2 different SSN's columns don't match and I need them too. Problem 2: The dates in column C need to stay associated with the same socials in column b.
This is fairly simple.
Either in a new sheet or in separate columns from your original data, create create a column that represents the same column as A or the original SSN's, this can easily be done with a simple reference formula =A1 and autofilled down. You can do the same for the second column that is a copy of the first SSN.
For the third column just use a simple INDEXand MATCHformula like this:
=INDEX(C:C,MATCH(E1,B:B,0))
This formula I have the new data in Columns E-G with this formula in column G.
What this formula is doing is looking for the value of E1 within column B (looking for the value of the first SSN within the span of the column B). It will then grab the date value from column C associated with the found value in B. This will not work if multiple of the same SSN's are found within column B.
Note: You have to set the formatting of the formula cell as a Date