Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
mr tom
 
Posts: n/a
Default Factorial (like =FACT) function?

A factorial expression, e.g. 5! is evaluated 5*4*3*2*1.

In Excel, this can be expressed as =FACT(5)

I want to do something similar, but a little different: 5+4+3+2+1

E.g. Year to date could be results for June + May + April + March + February
+ January, where Month(TODAY) gives 06 as June and then simply recalculates
the month sensitive formulas based on each month below this number, returning
the total of all evaluations.

Ideally I'd like to manage this within a formula, without resorting to VBA.
Any ideas?

Tom.

P.S. Many thanks for any attempts - regardless of whether they solve my
problem!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chip Pearson
 
Posts: n/a
Default Factorial (like =FACT) function?

Tom,

I'm not entirely clear on what you want to do, but you can add
the numbers between 1 and N with the array formula

=SUM(ROW(INDIRECT("1:"&A1)))

where A1 contains N.

Since this is an array formula, you must press CTRL+SHIFT+ENTER
rather than just ENTER when you first entire the formula and
whenever you edit it later. If you do this correctly, Excel will
display the formula in curly braces {}.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"mr tom" <mr-tom at mr-tom.co.uk.(donotspam) wrote in message
...
A factorial expression, e.g. 5! is evaluated 5*4*3*2*1.

In Excel, this can be expressed as =FACT(5)

I want to do something similar, but a little different:
5+4+3+2+1

E.g. Year to date could be results for June + May + April +
March + February
+ January, where Month(TODAY) gives 06 as June and then simply
recalculates
the month sensitive formulas based on each month below this
number, returning
the total of all evaluations.

Ideally I'd like to manage this within a formula, without
resorting to VBA.
Any ideas?

Tom.

P.S. Many thanks for any attempts - regardless of whether they
solve my
problem!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Factorial (like =FACT) function?

Try this:

For a value in A1

This formula returns the sum of all numbers from 1 thru the value in A1
B1: =(A1+1)*(A1/2)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"mr tom" wrote:

A factorial expression, e.g. 5! is evaluated 5*4*3*2*1.

In Excel, this can be expressed as =FACT(5)

I want to do something similar, but a little different: 5+4+3+2+1

E.g. Year to date could be results for June + May + April + March + February
+ January, where Month(TODAY) gives 06 as June and then simply recalculates
the month sensitive formulas based on each month below this number, returning
the total of all evaluations.

Ideally I'd like to manage this within a formula, without resorting to VBA.
Any ideas?

Tom.

P.S. Many thanks for any attempts - regardless of whether they solve my
problem!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dana DeLouis
 
Posts: n/a
Default Factorial (like =FACT) function?

I want to do something similar:... 5+4+3+2+1

If you are summing 1 to n, then maybe:
n(n+1)/2

ie 5*6/2 = 15
--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"mr tom" <mr-tom at mr-tom.co.uk.(donotspam) wrote in message
...
A factorial expression, e.g. 5! is evaluated 5*4*3*2*1.

In Excel, this can be expressed as =FACT(5)

I want to do something similar, but a little different: 5+4+3+2+1

E.g. Year to date could be results for June + May + April + March +
February
+ January, where Month(TODAY) gives 06 as June and then simply
recalculates
the month sensitive formulas based on each month below this number,
returning
the total of all evaluations.

Ideally I'd like to manage this within a formula, without resorting to
VBA.
Any ideas?

Tom.

P.S. Many thanks for any attempts - regardless of whether they solve my
problem!



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
mr tom
 
Posts: n/a
Default Factorial (like =FACT) function?

Not quite.

Another poorly asked question on my part!

Let's say you have a data source where one column is date. Another column
might be product. Another might be amount.

At the end of the month, you'd sum all the amounts where the product meets
certain criterea and MONTH(date entered in column) = MONTH(TODAY()).

This is how it presently works.

If I then wanted year to date, I could simply sum all cases for that year,
but let's say the data quality is not what it could be and having a series of
months that don't add up to the year to date total is a little embarrassing.

My alternative was a function that does
{=SUM(IF(Product="x"),IF(MONTH(DateEntered)=MONTH( TODAY()),Amounts,0),0)}
[the current formula or close to it]
but does this for the current month and every previous month until Month=0.

Am I clutching at straws?

"Ron Coderre" wrote:

Try this:

For a value in A1

This formula returns the sum of all numbers from 1 thru the value in A1
B1: =(A1+1)*(A1/2)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"mr tom" wrote:

A factorial expression, e.g. 5! is evaluated 5*4*3*2*1.

In Excel, this can be expressed as =FACT(5)

I want to do something similar, but a little different: 5+4+3+2+1

E.g. Year to date could be results for June + May + April + March + February
+ January, where Month(TODAY) gives 06 as June and then simply recalculates
the month sensitive formulas based on each month below this number, returning
the total of all evaluations.

Ideally I'd like to manage this within a formula, without resorting to VBA.
Any ideas?

Tom.

P.S. Many thanks for any attempts - regardless of whether they solve my
problem!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Factorial (like =FACT) function?

Maybe something like this:

For a data list in A1:C100
Col_A contains dates and a column title in A1
Col_B contains products and a column title in B1
Col_C contains amounts and a column title in C1

This formula sums all of YTD amounts (through the current month) where the
Prod="X"

D1:
=SUMPRODUCT((B2:B100="x")*(YEAR(A2:A100)=YEAR(TODA Y()))*(MONTH(A2:A100)<=MONTH(TODAY()))*C2:C100)

Note: in case text wrap impacts the display, there are no spaces in that
formula.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"mr tom" wrote:

Not quite.

Another poorly asked question on my part!

Let's say you have a data source where one column is date. Another column
might be product. Another might be amount.

At the end of the month, you'd sum all the amounts where the product meets
certain criterea and MONTH(date entered in column) = MONTH(TODAY()).

This is how it presently works.

If I then wanted year to date, I could simply sum all cases for that year,
but let's say the data quality is not what it could be and having a series of
months that don't add up to the year to date total is a little embarrassing.

My alternative was a function that does
{=SUM(IF(Product="x"),IF(MONTH(DateEntered)=MONTH( TODAY()),Amounts,0),0)}
[the current formula or close to it]
but does this for the current month and every previous month until Month=0.

Am I clutching at straws?

"Ron Coderre" wrote:

Try this:

For a value in A1

This formula returns the sum of all numbers from 1 thru the value in A1
B1: =(A1+1)*(A1/2)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"mr tom" wrote:

A factorial expression, e.g. 5! is evaluated 5*4*3*2*1.

In Excel, this can be expressed as =FACT(5)

I want to do something similar, but a little different: 5+4+3+2+1

E.g. Year to date could be results for June + May + April + March + February
+ January, where Month(TODAY) gives 06 as June and then simply recalculates
the month sensitive formulas based on each month below this number, returning
the total of all evaluations.

Ideally I'd like to manage this within a formula, without resorting to VBA.
Any ideas?

Tom.

P.S. Many thanks for any attempts - regardless of whether they solve my
problem!

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
mr tom
 
Posts: n/a
Default Factorial (like =FACT) function?

Yes - that's exactly it. I'll stick with my previous style of formula but
you're absolutely right - I deserve to be taken out and shot for not thinking
of a <=.

I've clearly overcomplicated things - your solution will work a treat.

Many thanks,

Tom.

"Ron Coderre" wrote:

Maybe something like this:

For a data list in A1:C100
Col_A contains dates and a column title in A1
Col_B contains products and a column title in B1
Col_C contains amounts and a column title in C1

This formula sums all of YTD amounts (through the current month) where the
Prod="X"

D1:
=SUMPRODUCT((B2:B100="x")*(YEAR(A2:A100)=YEAR(TODA Y()))*(MONTH(A2:A100)<=MONTH(TODAY()))*C2:C100)

Note: in case text wrap impacts the display, there are no spaces in that
formula.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"mr tom" wrote:

Not quite.

Another poorly asked question on my part!

Let's say you have a data source where one column is date. Another column
might be product. Another might be amount.

At the end of the month, you'd sum all the amounts where the product meets
certain criterea and MONTH(date entered in column) = MONTH(TODAY()).

This is how it presently works.

If I then wanted year to date, I could simply sum all cases for that year,
but let's say the data quality is not what it could be and having a series of
months that don't add up to the year to date total is a little embarrassing.

My alternative was a function that does
{=SUM(IF(Product="x"),IF(MONTH(DateEntered)=MONTH( TODAY()),Amounts,0),0)}
[the current formula or close to it]
but does this for the current month and every previous month until Month=0.

Am I clutching at straws?

"Ron Coderre" wrote:

Try this:

For a value in A1

This formula returns the sum of all numbers from 1 thru the value in A1
B1: =(A1+1)*(A1/2)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"mr tom" wrote:

A factorial expression, e.g. 5! is evaluated 5*4*3*2*1.

In Excel, this can be expressed as =FACT(5)

I want to do something similar, but a little different: 5+4+3+2+1

E.g. Year to date could be results for June + May + April + March + February
+ January, where Month(TODAY) gives 06 as June and then simply recalculates
the month sensitive formulas based on each month below this number, returning
the total of all evaluations.

Ideally I'd like to manage this within a formula, without resorting to VBA.
Any ideas?

Tom.

P.S. Many thanks for any attempts - regardless of whether they solve my
problem!

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Factorial (like =FACT) function?

Thanks for the feed back...I'm glad you got that to work for you.

BTW...this newsgroup hardly ever shoots anybody any more. <vbg

***********
Regards,
Ron

XL2002, WinXP


"mr tom" wrote:

Yes - that's exactly it. I'll stick with my previous style of formula but
you're absolutely right - I deserve to be taken out and shot for not thinking
of a <=.

I've clearly overcomplicated things - your solution will work a treat.

Many thanks,

Tom.

"Ron Coderre" wrote:

Maybe something like this:

For a data list in A1:C100
Col_A contains dates and a column title in A1
Col_B contains products and a column title in B1
Col_C contains amounts and a column title in C1

This formula sums all of YTD amounts (through the current month) where the
Prod="X"

D1:
=SUMPRODUCT((B2:B100="x")*(YEAR(A2:A100)=YEAR(TODA Y()))*(MONTH(A2:A100)<=MONTH(TODAY()))*C2:C100)

Note: in case text wrap impacts the display, there are no spaces in that
formula.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"mr tom" wrote:

Not quite.

Another poorly asked question on my part!

Let's say you have a data source where one column is date. Another column
might be product. Another might be amount.

At the end of the month, you'd sum all the amounts where the product meets
certain criterea and MONTH(date entered in column) = MONTH(TODAY()).

This is how it presently works.

If I then wanted year to date, I could simply sum all cases for that year,
but let's say the data quality is not what it could be and having a series of
months that don't add up to the year to date total is a little embarrassing.

My alternative was a function that does
{=SUM(IF(Product="x"),IF(MONTH(DateEntered)=MONTH( TODAY()),Amounts,0),0)}
[the current formula or close to it]
but does this for the current month and every previous month until Month=0.

Am I clutching at straws?

"Ron Coderre" wrote:

Try this:

For a value in A1

This formula returns the sum of all numbers from 1 thru the value in A1
B1: =(A1+1)*(A1/2)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"mr tom" wrote:

A factorial expression, e.g. 5! is evaluated 5*4*3*2*1.

In Excel, this can be expressed as =FACT(5)

I want to do something similar, but a little different: 5+4+3+2+1

E.g. Year to date could be results for June + May + April + March + February
+ January, where Month(TODAY) gives 06 as June and then simply recalculates
the month sensitive formulas based on each month below this number, returning
the total of all evaluations.

Ideally I'd like to manage this within a formula, without resorting to VBA.
Any ideas?

Tom.

P.S. Many thanks for any attempts - regardless of whether they solve my
problem!

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB
 
Posts: n/a
Default Factorial (like =FACT) function?

Not since the last time, anyway.

"Ron Coderre" wrote:

Thanks for the feed back...I'm glad you got that to work for you.

BTW...this newsgroup hardly ever shoots anybody any more. <vbg

***********
Regards,
Ron

XL2002, WinXP


"mr tom" wrote:

Yes - that's exactly it. I'll stick with my previous style of formula but
you're absolutely right - I deserve to be taken out and shot for not thinking
of a <=.

I've clearly overcomplicated things - your solution will work a treat.

Many thanks,

Tom.

"Ron Coderre" wrote:

Maybe something like this:

For a data list in A1:C100
Col_A contains dates and a column title in A1
Col_B contains products and a column title in B1
Col_C contains amounts and a column title in C1

This formula sums all of YTD amounts (through the current month) where the
Prod="X"

D1:
=SUMPRODUCT((B2:B100="x")*(YEAR(A2:A100)=YEAR(TODA Y()))*(MONTH(A2:A100)<=MONTH(TODAY()))*C2:C100)

Note: in case text wrap impacts the display, there are no spaces in that
formula.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"mr tom" wrote:

Not quite.

Another poorly asked question on my part!

Let's say you have a data source where one column is date. Another column
might be product. Another might be amount.

At the end of the month, you'd sum all the amounts where the product meets
certain criterea and MONTH(date entered in column) = MONTH(TODAY()).

This is how it presently works.

If I then wanted year to date, I could simply sum all cases for that year,
but let's say the data quality is not what it could be and having a series of
months that don't add up to the year to date total is a little embarrassing.

My alternative was a function that does
{=SUM(IF(Product="x"),IF(MONTH(DateEntered)=MONTH( TODAY()),Amounts,0),0)}
[the current formula or close to it]
but does this for the current month and every previous month until Month=0.

Am I clutching at straws?

"Ron Coderre" wrote:

Try this:

For a value in A1

This formula returns the sum of all numbers from 1 thru the value in A1
B1: =(A1+1)*(A1/2)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"mr tom" wrote:

A factorial expression, e.g. 5! is evaluated 5*4*3*2*1.

In Excel, this can be expressed as =FACT(5)

I want to do something similar, but a little different: 5+4+3+2+1

E.g. Year to date could be results for June + May + April + March + February
+ January, where Month(TODAY) gives 06 as June and then simply recalculates
the month sensitive formulas based on each month below this number, returning
the total of all evaluations.

Ideally I'd like to manage this within a formula, without resorting to VBA.
Any ideas?

Tom.

P.S. Many thanks for any attempts - regardless of whether they solve my
problem!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF function to blank without getting #value in sum function Brad Stevenson Excel Worksheet Functions 5 May 26th 05 10:26 AM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Hyperlinks using R[1]C[1] and offset function in its cell referenc Elijah-Dadda Excel Worksheet Functions 0 March 5th 05 03:31 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 07:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"