View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier Roger Govier is offline
external usenet poster
 
Posts: 2,886
Default How to repeat one cell specific times to form an array?

Hi

Better make that Inserted formula
=EVALUATE($C$1)
unless of course you wanted to have different values in A2, B2 and copy
the formula in C1 down to C2.
You could then leave the row relative and use $C1, and as you copy your
NPV formula down the page it would adjust to different values for the
params.

--
Regards

Roger Govier


"liups" wrote in message
ps.com...
thank you guys, that worked but that's different with what I'm
thinking, I'm trying to get a real array, yes which can be used in
another formula, like in
=NPV(0.04, -90, xxxxx(a1,b1))
by xxxx(a1,b1) I hope I can get an array which is a1 repeated b1
times, the result will be
=NPV(0.04, -90, {100,100,100})

can I do that without using VBA?

thanks a lot!

On May 13, 2:53 pm, "T. Valko" wrote:
That last part:

LEN(REPT(A1&", ",B1))-2)

Is being used to "clean-up". Without it, you get:

{100, 100, 100, }

With it, you get:

{100, 100, 100}

I'm wondering if the OP is trying to use this in another formula?

Biff

"Roger Govier" wrote in message

...

Hi Biff


Couldn't that be shortened to
=IF(COUNTA(A1:B1)<2,"","{"&REPT(A1&", ",B1)&"}")


--
Regards


Roger Govier


"T. Valko" wrote in message
...
Try this:


=IF(COUNTA(A1:B1)<2,"","{"&LEFT(REPT(A1&", ",B1),LEN(REPT(A1&",
",B1))-2)&"}")


Biff


"liups" wrote in message
roups.com...
Hi,
I need to repeat the content of a cell to form an array, like
this:
A1: 100
B1: 3
I want to put in C1 an array like this :{100, 100, 100}, but I
don't
know how to write the formula, any ideas?


thank you very much.