Copy a Range with an Excel Formula When a Cell Is Not Blank
Question details
Return the values in A1:A5 in another location only when A1 contains a value.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user wants a formula-driven copy of a range that depends on whether the first cell contains a value.
- Observed behavior
- The destination should display A1:A5 when A1 is not blank and appear blank otherwise.
Check your Excel version to determine whether it supports dynamic array formulas. Choose a destination outside A1:A5 and make sure its cells are empty.
Use a Dynamic Array Formula in Excel for Microsoft 365
Use one formula to return the range automatically in a version of Excel that supports dynamic arrays.
Click C1, or another empty cell outside A1:A5, and leave the four cells below it empty.
Type =IF(A1<>"",A1:A5,"") in the formula bar and press Enter.
Enter a value in A1 to display the source range in C1:C5. Clear A1 to return a blank result.

Use Individual Formulas in Older Excel Versions
Use a helper range when your Excel version does not support dynamic array spilling.
Return a Range Conditionally in WPS Spreadsheets
Use an IF formula and the fill handle in WPS Spreadsheets to display A1:A5 only when A1 contains a value.
- 1. Open the spreadsheet: Open your workbook in WPS Spreadsheets and locate the source range A1:A5.
- 2. Enter the IF formula: Click C1 and enter =IF($A$1<>"",A1,"") in the formula bar, then press Enter.
- 3. Fill the destination range: Select C1 and drag its fill handle down to C5 to copy the formula.
- 4. Verify the result: Enter a value in A1 to display the corresponding source values in C1:C5, or clear A1 to make the results appear blank.

Frequently Asked Questions
What does $A$1 do in the fill-down formula?
The dollar signs keep the condition fixed on A1 when you drag the formula down. The second reference, A1, changes to A2, A3, and so on.
Why does the dynamic array formula show #SPILL!?
A cell in the intended output range may be occupied. Clear the cells below the formula so Excel can display all five results.
Will the formula work if A1 contains a formula that returns an empty string?
No. The condition A1<>"" treats an empty-string result as blank, so the destination displays a blank result.
Why do some empty cells in A1:A5 appear as zeros?
A direct reference to an empty source cell can be displayed as zero. If you need those cells to appear blank, add a separate blank check for each source cell.




