Cell Value pickup from different sheet - excel

I have 5 sheets in a workbook namely Sheet1, Sheet2, Sheet3.... Maintaining some data in each sheet. In first sheet namely Consolidation I need the B3 Cell value of each sheet to be displayed in each cell
Table in the Consolidation sheet will be as below
SheetNo| Name | value (Value of B3 Cell of respective sheet )
| |
1 | Party 1 | Value of Sheet1!B3
2 | Party 2 | Value of Sheet2!B3
3 | Party 3 | Value of Sheet3!B3
4 | Party 4 | Value of Sheet4!B3
:
:
N | Party N | Value of Sheetn!B3
:
:
:
Z | Party Z | Value of SheetZ!B3
I want this to be done most likely through some cell functions only not using VBA Scripting

go to your Consolidation sheet:
a1: 1, a2: 2, a3: 3 etc
a2: ="Party "&a1
a3: =INDIRECT("Sheet"&a1&"!b3")
auto fill rest

Unless I'm missing something haven't you sort of already answered it with your example?
=SheetName!Address will return the value of Address on SheetName
If you wanted it a little more dynamic so you dont have to manually fill the sheet name, you could do something like this.
=INDIRECT("Sheet" & Row() & "!$B$3")
However it will only do numeric sheet names. (unless N and Z are just numbers then theres no problem)
Just looked and saw that you've got the sheet number next in Column A so you can substitue Row() for $A$1

To refer to a cell by name, you can use the INDIRECT() function, as in:
=INDIRECT("'"&$B1&"'!$B$3")
Here, B1 is the cell containing the name of your sheet. The expression inside the parentheses will evaluate to, for example, 'Party 1'!$B$3. INDIRECT() will expand that to the actual value of cell B3 in sheet Party 1.
The extra single-quotes are required to deal with the spaces in your sheet names.

Related

Excel IF/THEN/VLOOKUP Nested Formula

I have two tabs in an excel file. Sheet 1 and Sheet 2. I have been working on a nested IF/THEN/OR/AND formula in excel that needs to do the following:
In Sheet 1, I need to make sure that two columns - Name 1 and Name 2 - match. If they do not match, I need to make sure that Name 2 matches to a Name column in Sheet 2.
Formula must - If Name 1 and Name 2 in Sheet 1 match, then YES, else NO. If NO, then VLOOKUP Name from Sheet 2 and Match with Name 2 in Sheet 1. If there is a match then display YES, else NO.
So far I have two separate columns that check for this. The first uses an exact statement to match the two name columns in sheet 1. The second does a vlookup to see if the name appears in the second sheet. I need this in one cell formula if possible and I am not sure how to do so without splitting.
+----------+----------+--+--+----------+
| Sheet 1 | | | | Sheet 2 |
+----------+----------+--+--+----------+
| Column 1 | Column 2 | | | Column 1 |
| Name 1 | Name 2 | | | Name |
+----------+----------+--+--+----------+
You will need to adjust the formula below for your sheet names and ranges, but this is a formula that will check column A against column B and if not the same, will check column B against a vlookup table. It also lets you know if there was not a match found in the vlookup table instead of just giving the error code #N/A
=IF(A3=B3,"Columns Match",IFERROR(VLOOKUP(B3,Sheet2!A4:B14,2,FALSE),"No Match Found In Vlookup"))

How do I add information to a neighbouring cell if there is specific text in an existing cell?

I'm working with 311 datasets. I have monthly spreadsheets for a specific municipality with over 10,000 entries per sheet.
The columns in the datasheet provide details such as call description, time of call, date of call and the City Ward the call originated from.
Problem is that the spreadsheets only give the Ward number, i.e.:
creation_date | ward | call_description | call_type
01-Jan-15 | Ward 4 | Calendar to be Mailed | Solid Waste Collection
I have a separate spreadsheet that assigns shape coordinates for the respective ward:
OBJECTID | DESCRIPTIO | WARD_NUM | WARDNUMTEX | SHAPE_Length | SHAPE_Area
4 | XXXXX |4 | Ward 4 | 19871.78596 | 16418739.66
What I want to do is create a formula that when it sees Ward 4 in the one column, the SHAPE_Length and SHAPE_Area are assigned in the corresponding cell in the next column.
This is a job for vlookup().
Assuming that your tab with the shape coordinates is called wardinfo and that it starts in cell A1. Also assuming that your datasheets data starts in A1, meaning the ward number is in column B, your vlookup() to get the Shape_Length will be:
=vlookup(B1, wardinfo!C:F, 3, false)
And to get the Shape_Area:
=vlookup(B1, wardinfo!C:F, 4, false)
Just stick those in a new column on the same row and then copy them down.
You can use a VLOOKUP formula ( https://support.office.com/en-us/article/VLOOKUP-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1 ), something like
=VLOOKUP(B2,Sheet2!D:F,2,FALSE)
Where B2 is the cell in the ward column your looking up, D:F is the range of columns you're using in the other sheet as a database (D is the column in the other sheet that has the Ward 4 index string, the rest of the columns you need should be to the right of that), and 2 is the column number that has the value you want to use as the result of the lookup (in that example, D is column 1, E would be column 2, probably SHAPE_Length and F would be column 3, probably SHAPE_Area).
You would put the formula a second time specifying column 3 for the second piece of info. The formula would go in the cell where you want the answer.

VBA/Excel: Get cell from different sheet

Long story short: I have two sheets in Excel: Sheet1 which has two cells (A1 & A2) and Sheet2 (providing some data) which looks like this:
| A | B |
--|---|----|
1 | a | 5 |
2 | b | 10 |
3 | c | 15 |
4 | ...
So here's my problem: in Sheet1 when I enter "b" in A1 it should automatically enter 10 in A2.
Kinda like a simple find operation which will return the cell (or column) number and use that to return the value for the cell right next to it. But how do I do this?
Thanks in advance!
As mentioned before, a VLOOKUP is the simplest and fastest way but I assume you do not want to have a formula in that cell or on that whole Sheet1 for that matter? Here is one simple way to do the same in VBA while still using a VLOOKUP - just not on Sheet1:
Use Sheet2!Z1 for calculation, if that cell is used in your workbook, just use any other unused cell in an area that is hidded for example.
Formula in Sheet2!Z1 :
=VLOOKUP(Sheet1!$A$1,Sheet2!$A$B,2,FALSE)
Simple VBA to populate Sheet1!A2:
sum DoIt
Worksheets("Sheet1").Range("A2").Value = Worksheets("Sheet2").Range("Z1").Value
end sub
You can call the DoIt sub with a button for example and it will keep your Sheet1 / cell A2 clean of formulas.

Excel multi column lookup

I am unsure how to Google this one. I have a table that looks like the below
Last Name | First Name | Team A | Team B | Team C
Smith | John | X | |
Doe | Jane | | X |
This would be the main sheet. The names in this sheet are divided into other sheet depending on what department they are in. Those sheets are setup in the same formats with the same columns. If the people in the main sheet are marked with an X in one of the columns I would like that same column marked in marked in the department sheets.
Your best bet might be to create a hidden column A where the value is a combination of column B and column C on all of your tabs. You could then use the standard VLOOKUP wrapped in an IFERROR clause.
For example,
=IFERROR(VLOOKUP(A1,Sheet1!A:F,3,False),"")
The IFERROR handles the instance that you may have a name on a sub tab not on the main tab. It returns blank instead of #N/A. The VLOOKUP is checking the value in A1 to what is in A1 on your main tab. A1 would be the combination of First and Last. The VLOOKUP would need to be in each of your team columns shifting the column returned number in each VLOOKUP.

Excel: Create Custom Sheet 2 Based on Data in Sheet 1

I have two sheets in a spreadsheet. Each sheet has a first column with common values (however they are not sorted the same and they are not all there in each sheet).
What I'm trying to do, if possible, is put a formula in sheet 2, where, if column 1 is a match for sheet 1, copies selective data from certain columns in that same row in sheet 1, to certain columns in sheet 2.
Example:
Sheet 1 has a heading setup and sample data row like this:
Title | Day of Week | First | Last
Supervisor | Wednesday | Mike | Jones
Sheet 2 has a heading setup and sample data row like this:
Title | Surname | Weekday
Supervisor | (empty cell) | (empty cell)
After running the mystery formula I'm looking for, placed in the 2 empty cells above, sheet 2 should match on the Supervisor key in sheet 1 and copy in data I have specified into each column, such as:
Title | Surname | Weekday
Supervisor | Jones | Wednesday
(In this case I have told it to map the "day of week" column to weekday, and map the "last" column to "surname").
I hope this is easy/possible??? Help???
VBA is not necessary. You can use a simple VLOOKUP:
=VLOOKUP(cell to look-up,
range where you want to look up the values (first column *must* contain the keys to look-up) including all columns that you want to retrieve,
the position of the column to be retrieved relative to the first column specified in argument 2,
0 (specifies you want an exact match))
For example:
=VLOOKUP(A1, Sheet1!$A$1:$D$150, 2, 0) ' Retrieves the 2nd column matching criteria in A1
Please notice, however, that you need your keys to be unique. Matching information based on the title seems a bit odd since it is likely there will be more than one person assigned to a certain role. For example, there may be more than 1 supervisor.
Use INDEX and MATCH (better than VLOOKUP).
I suggest renaming your headers so they match on both sheet.
Sheet 1 should be :
Title | Weekday | First Name | Surname
In sheet 2, cell B2 type in
=INDEX(Sheet1!$A:$D,match($A2,Sheet1!$A:$A,0),match(B$2,Sheet1!$1:$1,0))
You can drag and drop it in column C as well, it will work since you are using two MATCH functions with the cells properly anchored.

Resources