Generate List of Data from different sheets in excel - 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

Related

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

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.

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 to use arrayformula to indicate an occurrence in google sheets

I'm trying to write an =arrayformula that finds the 1st, 2nd, 3rd, etc. occurrence of a value in another column. I can do this with a formula copied down all rows but I don't want to use this method, I need the arrayformula to simply always update the column because I need to constantly insert and delete rows and I don't want to have to keep copying the formula down. Thanks in advance.
Google sheet where I'm testing this.
Example formulas that I currently have to copy down..I want this to simply be an arrayformula instead:
values | occurance
aa | =if(A3<>"",countif($A$3:$A3,A3),"") | RESULT:1
2 | =if(A4<>"",countif($A$3:$A4,A4),"") | RESULT:1
aa | =if(A5<>"",countif($A$3:$A5,A5),"") | RESULT:2
5 | =if(A6<>"",countif($A$3:$A6,A6),"") | RESULT:1
5 | =if(A7<>"",countif($A$3:$A7,A7),"") | RESULT:2
4 | =if(A8<>"",countif($A$3:$A8,A8),"") | RESULT:1
Formulas that work but have to be copied down
Check out cell D3 where I used this formula:
=ArrayFormula(iferror(SORT(ROW(A3:A),SORT(ROW(A3:A),A3:A,1),1)-MATCH(A3:A,SORT(A3:A),0)-ROW()+2))
and see if that works for you ?

Increment count in column based on value in column

I've 2 columns A and B. A contains names and B contains the count of those names till that record as shown below.
-----------------------------------
| A | B |
-----------------------------------
1 | Fruits | 1 |
2 | Flowers | 1 |
3 | Fruits | 2 |
So, want to have a formula for this. Expecting an array formula. Even if an array formula is not possible, a general formula
Attached a spreadsheet so that it can be explained better.
https://docs.google.com/spreadsheets/d/1wlWqdFwgv90s50iP-bXXBHciyualohj610qFiSatcmQ/edit#gid=1997586177
You do not need an array formula, and I would avoid them when possible. You can accomplish your task with
=COUNTIF(A$1:A1,A1)
Where A1 if the first value in the column of values you want to count. The $ allows you to anchor the top of your COUNTIF range while leaving the bottom dynamic.
In a google spreadsheet you may want to try:
=ArrayFormula(iferror(SORT(ROW(A1:A),SORT(ROW(A1:A),A1:A,1),1)-MATCH(A1:A,SORT(A1:A),0)-ROW()+2))
Example sheet

Incrementing each row in excel that contains a number

I was sent an excel document in the following format:
A | B |
1 | abc |
| def |
2 | abc |
| def |
| ghi |
3 | abc |
| def |
So basically I have the first column which contains ordered numbers every couple of rows. I want to insert a row e.g. between 2 and 3, so that the new row will be numbered 3, and the rows below it are updated accordingly i.e. 3 becomes 4, 4 becomes 5 and so on.
I don't really use excel, but I am curious if there is there an easy way of doing this?
In A1, enter the following formula:
=IF(MOD(ROW(A1),2)=1,(ROW(A1)+1)/2,"")
And copy that formula down to the bottom of the range. Each time you insert a new row, you will need to manually copy the formula to the inserted row's first cell.
Is there a pattern in the b column, to distinguish if you need to jump to the next number?
if so use:
in cel A2 and further:
=IF(B2 = "abc",A1+1,A1)
With conditional formating, hide the repeating numbers: =A2=A1

Resources