INDIRECT RC Style cell addressing

visalX

New Member
Joined
Jun 17, 2018
Messages
2
I have taken over an Excel workbook with some complex macros. I am having difficulty working out which cell(s) a particular formula references. The extract from the macro is:

Range("F2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(INDEX(INDIRECT(RC[-4]&""!rngCost""),MATCH(RC[-3],INDIRECT(RC[-4]&""!rngSku""),0)),0)*RC[-2]"

rngCost references column F; rngSku references column B which is also RC[-4]

I understand IFERROR and the INDEX and MATCH functions but I'm having difficulty with the following:

Which cell does INDIRECT(RC[-4]&""!rngCost"") reference?
Which cell does INDIRECT(RC[-4]&""!rngSku"") reference?

Thanks for your help VisalX
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi & welcome to the board.
Further to what Jim has said B2 will be the name of a worksheet
 
Upvote 0
Thanks for your help. After looking at your answers I realise that cell B2 holds the name of the worksheet which contains the named ranges. It now makes sense.
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,721
Members
449,093
Latest member
Mnur

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