In the workbook on the left I have a list of Years (column A) and Country Codes (column B), and then on the top row a long list of World Bank development indicator names (columns C, D, E, etc.). In the workbook on on the right I have the values for each indicator for each year and each country. What I would like to do is to use a formula (index match or something else) in order to get the values for the indicators for the corresponding years and countries. Could anyone provide me with the formula that would solve this problem so I can apply it to all rows and columns? Thank you in advance for your help!:)
its an ARRAY Formula. You need to press CTRL + SHIFT + ENTER
{=INDEX($C$4:$E$15,MATCH(1,(A4:A15=$A$25)*(B4:B15=B25),0),MATCH(C24,C3:E3,0))}
Related
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.
Hope to have a relatively simple question.
I use VLOOKUP every day, for comparing 2 lists of itemnumbers and corresponding stock.
In a new situation itemnumbers are not longer in only one column, but the correct one could be in column A, B or C. While the stock is always in F.
Is it possible with VLOOKUP, or INDEX/MATCH to fill the corresponding stock in the orange cells, according to the itemnumber in one of three columns?
Many thanks in advance, Richard
Say we have data like:
We want to lookup the word hello in the table from A1 to H14 and retrieve the associated value from column J
Pick some cell, say K1, and enter:
Hello
Then in another cell enter the array formula:
=INDEX(J1:J14,MIN(IF($A$1:$H$14=K1,ROW($A$1:$H$14)-ROW($A$1)+1)))
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key.
Use AGGREGATE:
=INDEX(F:F,AGGRAGATE(15,6,ROW($A$1:$C$9)/($A$1:$C$9=B19),1))
I have a row with several months of values (C43:F43) that I want to sum on the farthest left column (B43).
When I add a new month in Col "C", I want the sum formula to dynamically include that new month in C43, but it moves over to start in Col D43.
I tried INDIRECT and it works to include the new column, but, if I insert a row above row 43, it messes up the formulas.
I then tried the OFFSET formula, but to no avail.
Any insight would be greatly appreciated. I now realize EXCEL is quite advanced.
Thank you.
Easy way: create a column to the right of your total, make it as narrow as possible (or hide it), and do your sum from this column (which will be column C) to the end of your data set. When you add a column (which will always be column D), your SUM will always cover it.
More complicated formula: you can use =SUM(OFFSET(B43,0,1,1,1000))
The offset formula can reference the cell you're in as long as you shift away from it. In the example above, I'm moving zero rows, one column to the right, in a range with height 1 cell and width 1000 cells. You can also if you have to end at column G use
=SUM(OFFSET(B43,0,1,COLUMN(G43)-2)
The G43 will move as you add columns so your formulae will stay in sync
To fix the column, put a $ sign before the column letter.
To fix the row, put a $ sign before the line number
=SUM($C$43:F$43)
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.
I have a table with student IDs separated in groups. I need a handy way to count the total number of students in each group and populate it after the last row of each group (marked with ??)
Currently I just enter =COUNT() and then manually figure out the top and bottom borders of the range for each group. Not convenient at all.
I was thinking that a possible solution could be one of the following:
A some kind of pivot table permutation. I failed on this one.
Excel Data->Outline->Subtotals functions. Again, fail. It keeps creating new rows in my table.
A universal formula that can be pasted into each ?? cell. Not the most graceful solution, but still would do.
A macro. As a last remedy if nothing else works.
The following steps will calculate the subtotals while preserving the structuring and formatting of your worksheet.
Put this formula in cell C1 and copy the formula down the column:
=IF(NOT(ISERROR(SEARCH("Total",A1))),COUNTA(INDIRECT("B"&MATCH(LEFT(A1,LEN(A1)-7),A:A,0)+1&".B"&(MATCH(A1,A:A,0)+1))),IF(B1="","",B1))
Apply a conditional format to cell C1 with the formula rule =(MOD(ROW(C1),2)=0) and blue fill to match the shading on the other rows. Copy the format down the column using Paste Special Format.
Either hide column B, or copy the values in column C to column B using Paste Special Values and hide Column C. If you decide to copy the values to column B, you won't need to set the conditional formats.
Here is what the formula does:
First, check whether the formula's row is a Total row, by searching the cell in column A of the row for the word "Total," using the SEARCH function.
If the word "Total" is found:
Determine the range in the worksheet of the student IDs for the group for that total row:
a) Identify the rows in which the words "GroupX" and "GroupX Total" are found by using the MATCH function. With that, you know that the IDs for the group are in a range that starts at, say, row x and ends at row y.
b) With the starting and ending row numbers, construct the address range in which the IDs lie, which has to be the string "B" + (row x) + "." + "B" + (row y).
c) Turn the string into a range reference that can actually used in a formula using the INDIRECT function.
Count the number of students in the group using the COUNTA function and the range, and show that as the formula's result.
If the word "Total" is not found
Check whether the cell in column B is empty
a) If it is empty, show a blank as the formula's result
b) if it is not empty, it must be a student ID, so show the ID as the formula's result.
Add a column (I usually add it to the LEFT of the existing matrix) where you enter a formula from row 2 onwards that fills the blanks in the old column A. Then the old matrix including your new column can be used in a pivot.
So Insert a column left of your matrix, this is column A now. Put a header in Cell A1, for example "Group Name1"
Enter the following formula in cell B2 and extend it to the end:
=IF(B2="",A1,B2) This way your blanks will be filled.
Now apply a pivot on this matrix and there you are.
Maybe not the nicest looking solution, but its quick and works well.
If u have table like this
Students id Name of students group ........
then u can use countif/countifs formula