I have a weird problem with referencing another sheet in my Googledocs spreadsheet. I have an address list with names, phones etc. and a category field. I have several tabs with a sheet for each category and a filter so I only have to enter the users once. This works fine, e.g. on one tab i have all users with category "Møbler". So this code works in the "Møbler" tab:
=query(Adresseliste!A2:I256;"select A,B,C,D,E,F,G,H,I where H contains 'Møbler' ")
The list shows up like this (returned 3 results):
Sorting Column 2
But I really want to sort the main list by column 1. But then strange things happen. I get a bunch of names in the first cell. What could be wrong? I tried to move the first few cells from the main list down but then it only displays the other first ones. The names in the first cell also do not match the search criteria. Sorting on Column 1 gives 3 results + a whole bunch of records in the first row.
Sorting Column 1
So there should be only returned 3 names but the first row is filled with names not even in the search. I can sort on any other column and it gives a correct result. But not on Column 1!
I solved the problem from reading here:
http://productforums.google.com/forum/#!topic/docs/Fn7Njk0JYPc
If you omit the last*";0"* it will treat the first cell as a header. This solved the problem anyone encounters this problem. Notice the last ;0
=query(Adresseliste!A2:I256;"select A,B,C,D,E,F,G,H,I where H contains 'Møbler' ";0)
Related
I have a couple of different large lists of equipment on seperate worksheets I am trying to consolidate. The first sheet "List" contains multiple columns of information, including one for the area it will be relocated to. Another sheet, "Locations," contains the three areas where each piece of equipment will be relocated to, seperated in to 3 columns; at the top of each column are the names of the locations 2500, 2900, and Term. The issue is, the Equip# from the "List" sheet only partially matches the names on the "Locations" sheet.
List
Locations
As you can see above, A2203-76 under Equip# only partially matches A2203-76 20% NAP TANK AGITATOR.
This is the formula I am using {=INDEX(Locations!$A$2:$C$2,,MIN(IF(Locations!A3:C151="A2203-76",COLUMN(Locations!A:C),0)))}. This unfortunately will only return the first column value, which is 2500. What should happen is: First, on the List sheet, the New Gear Location cell should check the Equip# cell in the same row, after retrieving the Equip# it should go to the Locations sheet and search for a partial match to what it retrieved from the Equip# cell. After finding a partial match, it should look at the column the match was found in and return one of the 3 cell values from the top "2500, 2900, or Term" based on what column it was found in and fill this value in the cell on the List page that the formula was entered in to.
Another issue, which makes me think this may not be possible, is there are also instances of A2203-75. So I question if excel has the ability to apply I guess "weights" to different partial matches. What I am getting at is, if I applied some function to partially match A2203-76 to something on the other page, would it just stop at A2203 and pick the A2203-75? Or would it look at the whole string first and find the correct instance? Maybe my thinking is wrong, but if you could offer any help I would appreciate it.
Is this what you mean?:
=INDEX(Locations!$A:$B,MATCH(List!$A2&"*",Locations!$C:$C,0),COLUMNS($A:A))
Paste this formula in List!B2 and drag right, down.
It searches for your search text followed by wildcard *.
!! Please note that this will return the first match.
If you are searching for A2203-76 and your data also contains A2203-761 it will return this value if it's found prior to A2203-76 !!
First, thank you for the help in solving this problem. It's pretty simple but I'm just not getting it.
In excel, I have 2 tabs. In the first tab, I have rows of personel data (job title, country of business, Industry, etc.)
In the second tab, I have a column of prohibited titles. These are titles that don't match the criteria we want.
I'd like to create a formula that checks the rows in tab 1 against the prohibited titles in tab 2. If the data matches, I'd like it to return 'N' in column A, which signals that we should remove that row of data. Title information is found in row F on tab 1.
My various countif functions aren't working and I'm not sure why.
Various countif formulas, like
=COUNTIF(F:F,"'Bad Titles!'A:A")
Produces N for all titles we want to disregard
Use MATCH it is quicker:
=IF(ISNUMBER(MATCH(F2,'Bad Titles!'A:A,0)),"N","")
If the matches are partial then:
=IF(SUMPRODUCT(--ISNUMBER(SEARCH('Bad Titles!'$A$1:$A$100,F2))),"N","")
I have a bunch of data that consist of Id Number and Names.
Image 1
{=IF(ISERROR(INDEX($A$2:$B$12;SMALL(IF($A$1:$A$16=$E$1;ROW($A$1:$A$12));ROW(1:1));2));"";INDEX($A$1:$B$12;SMALL(IF($A$1:$A$16=$E$1;ROW($A$1:$A$12));ROW(1:1));2))}
Previously (Image 1) I successfully able to return multiple value with A Name value from column Names that consist of only one name. I am using Index function Array formula to solve this problem.
But,I got stuck when I have multiple names in that Names column. What I want to do is to return multiple value of Id Number that consist of a multiple names separated by 'comma' inside Names column without modifying that column. Expected result is shown in Image 2.
Image 2
The problems are :
I want to get the value from the ID Number column based on Names
column that contain a name inside
I want to automatically get multiple values just like displayed in
Image 1
If there're two ID Number value that is the same, it will be deleted or not be shown in the result.
I don't mind any kind of method you guys will purposed to me. I will appreciate any solutions you offered. Thank you very much.
You can use
=IFERROR(INDEX($A:$A,SMALL(IF(ISNUMBER(FIND(E$1,$B$2:$B$11))*(COUNTIF(E$1:E1,$A$2:$A$11)=0),ROW($B$2:$B$11)),1)),"")
entered as an array formula using CtrlShiftEnter
or
=IFERROR(INDEX($A:$A,AGGREGATE(15,6,ROW($B$2:$B$11)/(ISNUMBER(FIND(E$1,$B$2:$B$11))*(COUNTIF(E$1:E1,$A$2:$A$11)=0)),1)),"")
entered normally.
EDIT
#Ron Rosenfeld is absolutely correct that the formulas as they stand would match (for example) Jo as well as John, although the effect is mitigated somewhat by the fact that they are using case-sensitive find with a capital letter at the beginning of each name (so Ange wouldn't match Hanger).
The modified formulas would be
=IFERROR(INDEX($A:$A,SMALL(IF(ISNUMBER(FIND(","&E$1&",",","&$B$2:$B$11&","))*(COUNTIF(E$1:E1,$A$2:$A$11)=0),ROW($B$2:$B$11)),1)),"")
and
=IFERROR(INDEX($A:$A,AGGREGATE(15,6,ROW($B$2:$B$11)/(ISNUMBER(FIND(","&E$1&",",","&$B$2:$B$11&","))*(COUNTIF(E$1:E1,$A$2:$A$11)=0)),1)),"")
So, I have a fairly involved workbook.
Sheet 1: A database where the user enters a list of instruments as well as some data about the instruments in a vertical column.
Sheet 2: A sheet that contains the exact same information as sheet 1 but displays it in a different format. Automatically populates based on entries from Sheet 1. (Not useful in this question)
There exists a macro on Sheet 1 that is executed by clicking a button. This macro takes every column from Sheet 1 and creates a new Sheet for each column. Each new sheet, Sheet 3, is renamed to the first value in the column of Sheet 1 that it represents.
i.e., There are 4 columns in Sheet 1 with the first value in each column being: LS-ALPHA, LS-BRAVO, LS-CHARLIE, LS-DELTA. My macro will create 4 new sheets called LS-ALPHA, LS-BRAVO, LS-CHARLIE, LS-DELTA.
The first cell (technically H2) on each of the new sheets contains a formula to reference the sheet name.
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
i.e., H2 on the LS-ALPHA sheet will actually say "LS-ALPHA", H2 on the LS-BRAVO sheet will say LS-BRAVO, etc.
Every other data cell on the new sheet will automatically look up that value on the main sheet (Sheet 1) to determine what column it is from. Then, it will go below that value and get the contents from some cell x rows below.
=LOOKUP(H2,'Database (Cols)'!D2:AN2,'Database (Cols)'!D3:AN3)
This works absolutely perfectly. It does everything well.
Except, not always.
If I rename the columns to "LS-A, LS-B, LS-C, LS-D", it works. If I rename the columns to "LS-AA, LS-AB, LS-AC, LS-AD", it works. If I rename the columns to "LS-AAA, LS-AAB, LS-AAC, LS-AAD", it works.
However, if I rename the columns to something like "LS-TTF, LS-TTD,LS-TSD, LS-TSF" they are all broken somehow.... None of the links on the sheets work any more. Some of them point to the incorrect column if they even do show something. This issue I'm having is incredibly peculiar. I don't know why these names break it in particular, nor do I know what other names would also break it.
What happens when it 'breaks': All of the references seem to find the last available column in the LOOKUP. Three of the four sheets all use values from the fourth column when they aren't supposed to. Then, one sheet just gives me errors (#N/A). When I step through the calculation, it is looking for the correct value in the LOOKUP function, it's just not returning the right thing....
I can't really give much more information without showing you what's happening so I've included a working spreadsheet and a broken spreadsheet. The sheets have been generated from the macro so you don't have to mess with it. The working and broken files are below:
Working: https://drive.google.com/file/d/0B9zbU-BeMQNfSmRrWVhKVW9RN3M/view?usp=drivesdk
Broken: https://drive.google.com/file/d/0B9zbU-BeMQNfd1FUemwxQjQwMEE/view?usp=drivesdk
Note, the echo column is for debugging purposes. I was trying to see if they would all show echo instead of delta. Apparently, they don't.
From the help for the LOOKUP function:
IMPORTANT: The values in lookup_vector must be placed in ascending
order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, LOOKUP
might not return the correct value. Uppercase and lowercase text are
equivalent.
The set of values which work correctly - "LS-A, LS-B, LS-C, LS-D" - are in alphabetical order. The set of values which don't work correctly - "LS-TTF, LS-TTD, LS-TSD, LS-TSF" - are not in alphabetical order. Also, LOOKUP doesn't necessarily find an exact match - as specified in the help:
If the LOOKUP function can't find the lookup_value, the function
matches the largest value in lookup_vector that is less than or equal
to lookup_value.
To fix, either:
reorder the non-working set of values to be in alphabetical order (although you still won't guarantee an exact match), or
switch to using the HLOOKUP function instead. Ensure that the Range_lookup parameter is false to require an exact match. Sample usage: =HLOOKUP(H2,'Database (Cols)'!D2:AN3,2,FALSE)
I had a similar problem because I was wrongly using lookup. To find a value in a vector, I had to use
=MATCH("KEY";F5:F48;0)
instead of
=LOOKUP("KEY";F5:F48)
LOOKUP just didn't work for my objectives.
I have an excel sheet with 8000 records that i would like to search by postcode.
This is my client list and i would like to say search for all clients living in the "EH1","EH2","KY1","SW9" postcodes.
I would like the search to return all the values related to that postcode.
The excel document is laid out like this.
(ID,Name,Surname,Address,Postcode,Telephone Number)
Im a novice at excel spreadsheets so any help on this would be greatly appreciated.
ID Name Surname Address Postcode Telephone number
26584 John Smith 69 Bedford road Eh12 5db 0131225689
Thanks
Edited with quick and dirty method:
If you only need to use this table a few times, then there is a quick and dirty method:
Make a helper column that only includes the first 3 characters of the postcode. You do this via the left function, specifying the postcode column in the first argument, then "3" in the next, to return the first 3 characters. This effectively hides the values you haven't ticked.
You then use the filter section at the top of the column once you have made it a table as stated earlier. In the drop down menu untick "Select all", then tick the values you want to see, i.e. the postcodes you are interested in).
You can then copy the visible cells only via Copy visible cells only if you want to use just that list.
A longer, but more robust method would involve three tables. The first is your data set as it is, with the helper column as discused above included. The second would be a simple single column of all the first three letter codes you are interested in. The third would be an array function modified from this formula:
=index($a$1:$b$7,small(if($a$1:$a$7=$a$10,ROW($a$1:$a$7)),ROW(1:1)),2)
which returns multiple items based on preset criteria, ignoring those that are not specified. I would link to a site explaining this better but I am such a new user I can hardly do anything it seems :(
I suggest you simply use an autofilter on the respective column.
Here is a short tutorial for Excel 2010: AUTOFILTER TUTORIAL
I think an easy way to do this is first make Postcode column first; from Column E to Column A.
Insert a new column in Column A, then use the left function to get the first 3 characters of the postcode: =LEFT(B1,3)
With this, you can use VLOOKUP to search for the postcodes "EH1","EH2","KY1","SW9", and use multiple VLOOKUP formulas to return a column index of everything.
You'll end up with a list of everything for that specific postcode.