N() Function and Offset

themev

Board Regular
Joined
Aug 13, 2007
Messages
83
I received a spreadsheet and am trying to understand a block of formulas. Can someone explain to me what this formula is actually doing?

Cell F18 =SUMPRODUCT($C10:F10,N(OFFSET(F3,0,-COLUMN($C3:F3)+COLUMN($C3))))

How does this formula work? The second 'array' doesn't appear to be an array.

I wish I could figure out how to put a picture of my spreadsheet into this post, but I cannot seem to use the HTML sheets at work.

This is C3:F3:
2.0000 3.0000 4.0000 4.0000
This is C10:F10
- - 1.000 2.000

and the formula returns a value of 7.00. I cant figure out how though.

Any help would be appreciated.
Thanks
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
CDEF
32344
4
5
6
7
8
9
1012
11
12
13
14
15
16
17
187

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
F18=SUMPRODUCT($C10:F10,N(OFFSET(F3,0,-COLUMN($C3:F3)+COLUMN($C3))))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



It's calculating C10*F3+D10*E3+E10*D3+F10*C3, or 0*4+0*4+1*3+2*2 = 7.

The OFFSET is used to reverse C3:F3 by starting at F3 and using the -COLUMN($C3:F3)+COLUMN($C3) structure to generate {0,-1,-2,-3}, giving {4,4,3,2}. The N() function converts the spaces to zeros.

Hope this helps!
 
Upvote 0
Eric - wow. thank you, thank you, thank you! Now I see what they are doing.

I spent way too much time trying to figure it out (to no avail).
 
Upvote 0

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

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