How to use Excel's array-formulas for a UDF to read each cell correctly?

前端 未结 2 1744
旧时难觅i
旧时难觅i 2020-12-16 03:38

G\'Day,

I have a question more towards helping myself understand how Excel\'s array-formulas (Control+Shift+Enter) can read each cell dynamically into the formula.

2条回答
  •  余生分开走
    2020-12-16 04:07

    The purpose of using Array formulas for the given sample is really obscure for me, but anyway, if you insist - try the following:

    1. Select region C3:C7 (as on your topmost screen).
    2. Press F2 to edit on the spot and type the following formula: =MakesSound(B2:B7)
    3. Press CTRL+SHIFT+ENTER instead of usual ENTER - this will define an ARRAY formula and will result in {} brackets around it (but do NOT type them manually!).

    I'm not sure whether your UDF may handle array notation properly, but for usual Excel formulas this works as expected, e.g. try =LEFT(B2:B7,2) as an array one for step 2 - and this will return 2 starting letters from each animal name.

    Hope that was somehow helpful. Good luck!

提交回复
热议问题