Transfer data from one worksheet to another while skipping blanks

hatmix5

New Member
Joined
Feb 15, 2021
Messages
1
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi,

In Sheet 1 I have the below data:
A1
B2
B3
A4

Then in Sheet 2 I have another worksheet with these formulas in Cells A1-A4 independently:
Cell A1 =IF('Sheet 1'!$A1="A",'Sheet 1'!B1," ")
Cell A2 =IF('Sheet 1'!$A2="A",'Sheet 1'!B2," ")
Cell A3 =IF('Sheet 1'!$A3="A",'Sheet 1'!B3," ")
Cell A4 =IF('Sheet 1'!$A4="A",'Sheet 1'!B4," ")

This produces the following table on Sheet 2:
1
4

How can I make it so the two blanks in between the 1 and 4 are skipped, while also allowing the numbers/blanks to move depending on how the data in Sheet 1 is changed (i.e. the order of A's and B's). The table would look like this:
1
4

Thank you
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Not really sure what you were looking for but this was what I found

Book1
AB
1AA
2BA
3B 
4A 
Sheet1
Cell Formulas
RangeFormula
B1:B4B1=IFERROR(INDEX(A$1:A$4,SMALL(IF(A$1:A$4="A",ROW(A$1:A$4)-ROW(A$1)+1),ROWS(B$1:B1))),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi & welcome to MrExcel.
Another option
+Fluff 1.xlsm
AB
1A1
2B2
3B3
4A4
5
Sheet1


+Fluff 1.xlsm
A
11
24
3 
4 
Sheet2
Cell Formulas
RangeFormula
A1:A4A1=IFERROR(INDEX(Sheet1!$B$1:$B$100,AGGREGATE(15,6,(ROW(Sheet1!$A$1:$A$100)-ROW(Sheet1!$A$1)+1)/(Sheet1!$A$1:$A$100="A"),ROWS(A$1:A1))),"")
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,721
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top