What's this excel formula do?

mcphee

New Member
Joined
Apr 1, 2002
Messages
3
Can you tell me what this formual does? Need to know why it's pulling the result it is. (Previous user's spreadsheet.)

=IF(ISERROR(F2),0,LOOKUP(C2,INDIRECT(ADDRESS(F2,5,,,F$1)):INDIRECT(ADDRESS(F2,15,,,F$1)),INDIRECT(ADDRESS(F2+1,5,,,F$1)):INDIRECT(ADDRESS(F2+1,15,,,F$1))))

Thank you.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
On 2002-04-02 09:55, mcphee wrote:
Can you tell me what this formual does? Need to know why it's pulling the result it is. (Previous user's spreadsheet.)

=IF(ISERROR(F2),0,LOOKUP(C2,INDIRECT(ADDRESS(F2,5,,,F$1)):INDIRECT(ADDRESS(F2,15,,,F$1)),INDIRECT(ADDRESS(F2+1,5,,,F$1)):INDIRECT(ADDRESS(F2+1,15,,,F$1))))

Thank you.

It's doing a lookup on a computed range including the file+sheet where the range should be.

ADDRESS(F2,5,,,F$1)

is the essential bit, where

F2 houses a value that is treated as a row number, 5 is the column number, and F$1 contains a (file plus) sheet name.

The Help file of Excel has the following info on ADDRESS:



ADDRESS

Creates a cell address as text, given specified row and column numbers.

Syntax

ADDRESS(row_num,column_num,abs_num,a1,sheet_text)

Row_num is the row number to use in the cell reference.

Column_num is the column number to use in the cell reference.

Abs_num specifies the type of reference to return.

Abs_num Returns this type of reference
1 or omitted Absolute
2 Absolute row; relative column
3 Relative row; absolute column
4 Relative


A1 is a logical value that specifies the A1 or R1C1 reference style. If a1 is TRUE or omitted, ADDRESS returns an A1-style reference; if FALSE, ADDRESS returns an R1C1-style reference.

Sheet_text is text specifying the name of the worksheet to be used as the external reference. If sheet_text is omitted, no sheet name is used.
 
Upvote 0
Aladin,

Thank you very much for your time and kind reply.

I previously read the Help File info concerning ADDRESS, but wasn't clear on what was going on w/this formula. I am still unclear on how this formula is working, as it presents a different result based on different numbers (quantities) entered into cell C2. I don't see what is telling the formula cell to choose which results. (IE: a low quantity entered produces a higher result/price, a high quantity entered produces a lower result/price.) If I understand what is happening, I am looking for where the quantity breakdowns are telling the formula which prices to produce as the result and where those prices are. I don't see those prices in an associated file anywhere.

Appreciate your help and time,
mcphee
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

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