Conditional Lookups with Relative Cell Referencing

chris_bosten

New Member
Joined
Aug 21, 2024
Messages
19
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I hope you can help.

I have the following sheet called "capacity planner":

Planned Date for JobDay of WeekJob IDIntervention TypeWO NumberFTE Required
15/01/2025WednesdayMJID0018RTTWO4567200181
14/01/2025TuesdayMJID0019RTTWO4567100192
13/01/2025MondayMJID0001RTC-IWO4567000011
13/01/2025MondayMJID0001RTC-RWO4567000011

The FTE required depends on whether "RTC-R" appears in the D column.

If it does, I need the formula to return a value in a separate sheet called "RA Raw Data" from column AJ, using the JOB ID in capacity planner (column C) with the JOB ID in "RA Raw Data" (column R) as the matching value. However, if the information in column D is not "RTC-R" I need the formula to return a value from column AF in "RA Raw Data" using the same matching value.

I have tried
=IF(D2="RTC-R",VLOOKUP('Capacity Planner'!C2:C100000,'RA Raw Data'!R2:AJ100000,19,FALSE),VLOOKUP(C2:C100000,'RA Raw Data'!R2:AF100000,15,FALSE))
and I have also tried a similar index-match forumula.

However, both of these only return values from AF, not in AJ, regardless of whether "RTC-R" appears in column D. I believe it's because of relative referencing in D2. When I write the formula and press enter, all the cells beneath populate with the formula, but they retain "D2" rather than going down "D3","D4" etc.

Is there any way I can fix this?

Best wishes
Chris
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
you need a lookup value
NOT a range
=IF(D2="RTC-R",VLOOKUP('Capacity Planner'!C2,'RA Raw Data'!R2:AJ100000,19,FALSE),VLOOKUP(C2,'RA Raw Data'!R2:AF100000,15,FALSE))
and copy down
 
Upvote 0
Solution

Forum statistics

Threads
1,225,725
Messages
6,186,650
Members
453,367
Latest member
bookiiemonster

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