dynamic formula that references the column row within the formula

kiwikiki718

Board Regular
Joined
Apr 7, 2017
Messages
80
Office Version
  1. 365
Platform
  1. Windows
Hi I was wondering there was a formula that I can use where one of the references could be dynamic based upon the column the formula is in.


for example I have the below formula in column B

=IF(MONDAY!J3=(TEXTBEFORE(B1,"_")),MONDAY!K3,IF(MONDAY!J4=(TEXTBEFORE(B1,"_")),MONDAY!K4,IF(MONDAY!J5=(TEXTBEFORE(B1,"_")),MONDAY!K5,IF(MONDAY!J6=(TEXTBEFORE(B1,"_")),MONDAY!K6,IF(MONDAY!J7=(TEXTBEFORE(B1,"_")),MONDAY!K7,IF(MONDAY!J8=(TEXTBEFORE(B1,"_")),MONDAY!K8,IF(MONDAY!J9=(TEXTBEFORE(B1,"_")),MONDAY!K9,IF(MONDAY!J10=(TEXTBEFORE(B1,"_")),MONDAY!K10,IF(MONDAY!J11=(TEXTBEFORE(B1,"_")),MONDAY!K11,IF(MONDAY!J12=(TEXTBEFORE(B1,"_")),MONDAY!K12,""))))))))))

Instead of referencing B1 I want to know I can replace B1 to reflect whatever column the formula is in. so if the above formula was in Column C then "B1" would show C1 within the formula.


thanks in advance
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
How about like
Excel Formula:
=LET(a,TEXTBEFORE(INDEX(A1:ZZ1,,COLUMN()),"_"),IF(MONDAY!J3=a,MONDAY!K3,IF(MONDAY!J4=a,MONDAY!K4)))
 
Upvote 0
Solution
How about like
Excel Formula:
=LET(a,TEXTBEFORE(INDEX(A1:ZZ1,,COLUMN()),"_"),IF(MONDAY!J3=a,MONDAY!K3,IF(MONDAY!J4=a,MONDAY!K4)))
Thank you I made the updates to the formula but now the formula shows a text in excel.

VBA Code:
=LET(a,TEXTBEFORE(INDEX(A1:ZZ1,,COLUMN()),"_"), IF(MONDAY!J3=a,MONDAY!K3,IF(MONDAY!J4=a,MONDAY!K4,IF(MONDAY!J5=a,MONDAY!K5,IF(MONDAY!J6=a,MONDAY!K6,IF(MONDAY!J7=a,MONDAY!K7,IF(MONDAY!J8=a,MONDAY!K8,IF(MONDAY!J9=a,MONDAY!K9,IF(MONDAY!J10=a,MONDAY!K10,IF(MONDAY!J11=a,MONDAY!K11,IF(MONDAY!J12=a,MONDAY!K12,""))))))))))
 
Upvote 0
You're missing a final closing bracket.
 
Upvote 0
Looks like when I entered the formula, the excel auto correct option popped up and I selected ok and it reverted back referencing the actual cell.
 
Last edited:
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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