IF X then display Range A in Range B

indygo

Board Regular
Joined
Dec 2, 2013
Messages
126
Office Version
  1. 365
Platform
  1. Windows
hi,

I'm looking for a formula to display a range of cells if condition is met.

For example IF A1 equals to "test" then display range F1:G4 in range B1:D5.

Any ideas?

Thank you
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
The range F1:G4 is 8 cells but B1:D5 is 15 cells. What are you trying to do exactly?
 
Upvote 0
It's a form of data validation to display only information that's relevant.

let's say you have 3 tables (or ranges) and you don't need to display all of them at once because they won't fit on one page so you can display only the one that you need based on X value.
 
Upvote 0
That still doesn't explain the 7 cell difference between the 2 ranges. Can you provide a sample?
 
Upvote 0
Sorry,
Let's assume ranges are equal, slightly different example:


Display range based on A1 in range A2:C9 from range O2:O9 or range V2:Y9


ABCDEFGHIJKLMNOPQRSTUVXYZAAABACAD
1CatDogCat
20.20.30.50.50.40.30.20.30.5
30.10.990.40.30.40.50.10.990.4
40.30.30.10.22.53.50.30.30.1
50.50.40.50.4
60.10.20.10.2
7
8
9

<tbody>
</tbody>
 
Upvote 0
OK.

Select each range in your table, excluding the header and name it using the value in the header.
Make sure you have any blanks in your table as ="" (If you don't do this, you will end up with zeros in your result cells)

In Columns A2:C, select the max amount of rows you would need and enter the following formula:
=INDIRECT(A1) and hit CTRL-SHIFT-ENTER rathern than just Enter.

Select Columns A:C and make a new Conditional Formatting Formula of =ISNA(A1) and format the font to white to hide all #N/A that will result from where there is no data in that spot.


Excel 2010
ABC
1Cat
20.20.30.5
30.10.990.4
40.30.30.1
50.50.4
60.10.2
Sheet1
Cell Formulas
RangeFormula
A2:C20{=INDIRECT(A1)}
Press CTRL+SHIFT+ENTER to enter array formulas.



Excel 2010
ABC
1Dog
20.50.40.3
30.30.40.5
40.22.53.5
Sheet1
Cell Formulas
RangeFormula
A2:C20{=INDIRECT(A1)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,586
Messages
6,120,402
Members
448,958
Latest member
Hat4Life

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