Share via

How do I keep column reference from changing in a formula when I add new columns?

Anonymous
2024-12-04T17:44:19+00:00

I have an excel where I collect data every two weeks, and then the following formula to search that range of data:

=TEXTJOIN(" ",TRUE,IF(Current!D:D="x2",Current!B:B,""))

However, every two weeks I add blank columns to collect new data for that time period. When I add the new columns, the first column reference gets bumped over. For instance, the above formula becomes the following:

=TEXTJOIN(" ",TRUE,IF(Current!G:G="x2",Current!B:B,""))

When I add the new set of columns, I want the formula to not change the columns from D to G. I want them to remain on D.

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Ashish Mathur 102K Reputation points Volunteer Moderator
    2024-12-04T22:59:46+00:00

    Hi,

    Does this work?

    =TEXTJOIN(" ",TRUE,FILTER(Current!B:B,INDIRECT(Current!D:D)="x2",""))

    Also, avoid giving entire ranges in formulas. Specify the range in which you have data.

    Was this answer helpful?

    0 comments No comments
  2. HansV 462.6K Reputation points
    2024-12-04T19:41:23+00:00

    Use the INDIRECT function:

    =TEXTJOIN(" ",TRUE,IF(INDIRECT("Current!D:D")="x2",Current!B:B,""))

    Was this answer helpful?

    0 comments No comments