Is there a way in Excel to extract rows by column string value? - excel

Can someone help me with excel? I want to extract data by OU name to different sheets. I'm aware of using filters or using a text-to-column function, but for filters, it's just manual work which would love to automate, and for the text-to-column function it does not work as some of the rows have more parameters than others. Please see per example:
Sheet 1 (Main)
Name | dn
A1 | CN=A1,OU=int,OU=Region1, DC=company,DC=com
A2 | CN=A2,OU=Ext,OU=AddiotionalInfo, OU=Region1,DC=company,DC=com
B1 | CN=B1,OU=int,OU=Region2,DC=company,DC=com
B2 | CN=B2,OU=ext, OU=Region3,DC=company,DC=com
C3 | CN=C3,OU=ext, OU=Region2,DC=company,DC=com
Is it possible to extract data to:
Sheet 2 by OU=Region1
Name | dn
A1 | CN=A1,OU=int,OU=Region1, DC=company,DC=com
A2 | CN=A2,OU=Ext,OU=AddiotionalInfo,OU=Region1,DC=company,DC=com
Sheet 3 by OU=Region2
Name | dn
B1 | CN=B1,OU=int,OU=Region2,DC=company,DC=com
C3 | CN=C3,OU=ext,OU=Region2,DC=company,DC=com
Sheet 4 by OU=Region3
Name | dn
B2 | CN=B2,OU=ext,OU=Region3,DC=company,DC=com
There are more regions to it so maybe there’s a formula in which it would be possible to enter “RegionX” and extract it to the second sheet?
I’m pretty new to excel and how to extract data so any resources would also be helpful. A lot of information provided on google regards the extraction of data by numbers, not by values.
Thank you!

If you have Excel 365 you can use this formula:
=FILTER('Sheet 1'!A2:B6,ISNUMBER(FIND("OU=" & A1,'Sheet 1'!B2:B6)))
It assumes that the data are on Sheet 1 and the region to be filtered for in A1 of the target sheet.

Related

Extracting all information(different) with same row name form a excel worksheet using formula

I have a excel workheet having a table with multiple rows having same name with different information in the corresponding columns. Now using a formula I want to extract this infomation into a new table? SOLUTION HAS TO BE USING AN EXCEL FOMULA ? NO FILTERS NO PIVOT TABLE OR VBA
I have tried vlookup. to search for multiple values. I dont want information from a single column but rather from all the columns. There could be thousands of columns with same and different values.
I have tried this formula : =INDEX(Worksheet!A2:AK350;KKLEINSTE(WENN((A5=Worksheet!A2:A350);VERGLEICH(ZEILE(Worksheet!A2:A350);ZEILE(Worksheet!A2:A350));"");1))
The table looks like this for example:
Place People Salary Status
japan | resident_1 | 564 | un-married
Delhi | resident_1 | 655 | un-married
china | resident_1 | 564 | un-married
japan | resident_2 | 748 | un-married
Now I want to extract a sub table from the above, like all the
infomation having PLACE name as "japan"
the reult should be this for each place in a different table:
japan | resident_1 | 564 | un-married
japan | resident_2 | 748 | un-married
Seems like a job for advanced filter, but you've already stipulated "no filters". If you're able to add two helper columns in your main table, maybe you can use the approach below.
This is my main_table worksheet (note the columns outlined in red, which have been added).
The formula in column E (starting from cell E2) is: =CONCAT(A2,"|",B2,"|",C2,"|",D2)
The formula in column F (starting from cell F2) is: =ROW()-ROW($F$2)+1
Drag/fill these formulas down to the last row in your main table.
This is my sub_table worksheet (note the cells outlined in green at the top, where you will eventually specify filter criteria).
The formula in column A (starting from cell A5) is: =ROW()-ROW($A$5)+1
The formula in column B (starting from cell B5) is: =IFERROR(SMALL(IF(ISNUMBER(SEARCH($B$2,main_table!$E$2:$E$10)),main_table!$F$2:$F$10,""),$A5),"")
The formula in columns C, D, E, F (starting from cell C5) is: =IF(ISNUMBER($B5),INDEX(main_table!$A$2:$D$10,$B5,COLUMNS($C5:C5)),"")
The formula in cell B2 is: =CONCAT(IF(ISBLANK($C$2),"*",$C$2),"|",IF(ISBLANK($D$2),"*",$D$2),"|",IF(ISBLANK($E$2),"*",$E$2),"|",IF(ISBLANK($F$2),"*",$F$2))
You should drag the formula down for the same number of rows that are in your main table.
I think newer/upcoming versions of Excel have a JOIN worksheet function which is more convenient/flexible than my usage of CONCAT above (so maybe use that if it's available to you).
Leaving the filter criteria blank should give you all rows. If you want partial matches, include wildcards in your input e.g. jap* or resident_*. If any of the values in your main table contain a |, you may want to use a different delimiter in the CONCAT formulas (otherwise you may get unexpected results/behaviour).
Once you're done, maybe you can use it like shown below:
See if this approach is any good for you (you will probably need to translate the formulas to your locale/region).

Excel Formula - Return unique count of range based on multiple criteria from different tables

I have three tables: Parties, Document Detail and Document. (Note, they are not table formatted, so all references are based on cell and sheet location, not table aliases)
I want to return a unique count of the parties in each Document using an Excel Formula. My problem is, I would usually use a =COUNTIFS() formula for this, which would be something like the following, which I would put in B2 of Sheet 3 (Document table):
=COUNTIFS(Sheet2!A:A,A2,Sheet2!B:B,Sheet1!A2)
But this will only return the count of one criteria at a time, not a count checking for all values of the parties table per document. I understand it should be able to be done with an array formula, but I can't figure it out. Bonus points if someone can figure out how to do it with a non-array formula!
Sheet1 - Parties Table
A
1|Parties |
+-----------------+
2|Education Officer|
3|Elder |
4|Family Support |
5|Interpreter |
Sheet2 - Document Detail Table
A B
1 |Doc ID | Party |
+-------+-----------------+
2 |FID0001|Education Officer|
3 |FID0001|Elder |
4 |FID0001|Education Officer|
5 |FID0001| |
6 |FID0001| |
7 |FID0002|Elder |
8 |FID0002|Interpreter |
9 |FID0002|Family Support |
10|FID0002| |
Sheet3 - (Desired Result) - Document Table
A B
1|Doc ID |Party Count|
+-------+-----------+
2|FID0001| 2 |
3|FID0002| 3 |
TL:DR
What combination of Excel formulas can I use to return the number of unique parties referenced in each document?
Based on this answer by Barry Houdini and expanded to include the DocID criteria
Put a helper column on Sheet2, lets say in colum C
=IFERROR(1/COUNTIFS($B:$B,$B:$B,$A:$A,$A:$A),0)
and copy down for all data rows
Then, in Sheet3 Party Count Formula is
=SUMIFS(Sheet2!$C:$C,Sheet2!$A:$A,$A:$A)
The non-Implicit Intersection versions
Sheet2 cell C1
=IFERROR(1/COUNTIFS($B:$B,$B1,$A:$A,$A1),0)
Sheet3 cell B2
=SUMIFS(Sheet2!$C:$C,Sheet2!$A:$A,$A2)

Generate List of Data from different sheets in excel

Here's the thing, I want to display a list of data from different sheets in excel file
Ex:
Sheet 1:
| A | B
--|---------------|--------------
1 | Payee: | Pedro
2 | Check Number: | 15263
3 | Date: | 12/05/2016
Sheet 2:
| A | B
--|---------------|--------------
1 | Payee: | Juan
2 | Check Number: | 15685
3 | Date: | 12/06/2016
and So on
Then in final sheet Display :
CheckNumber
15263
15685
I tried different formulas like VLOOKUP, INDIRECT, still I can't find answers.
Copy paste is not an option because I want it to be dynamic
Hope you guys Help
Assupmtions:
1. Name of the sheets of your workbook are Sheet1, Sheet2, Sheet3, and so on....
2. Check Number is always in Cell B2 of all sheets.
Enter the following formula in the second row of the column you want to list down Check Number and copy/drag it down(say Column B).
=INDIRECT("Sheet"&ROW()-1&"!"&"$B$2")
This will give you following output:
Actually i find a code here :https://msdn.microsoft.com/en-us/library/cc793964.aspx
i tried it and it works, though i use VBA because i cant find a formula for it

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.

Cell Value pickup from different sheet

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.

Resources