Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Harold Good
 
Posts: n/a
Default reducing the number of times an IF statement needs to be calculated in embedded IF statements

Hi,

I have a long formula that is getting too long. It has 3 embedded IF
statements, with the logical test below having to be calculated each time.
(Planning!X14/365.25)+1900-INT((Planning!X14/365.25)+1900)

For example, when the logical test solves this to 2004, is there some way to
store that "2004" in memory the first time and recall it as "2004" in the
formula for the other two logical tests. Otherwise the formula is getting so
long, and these three embedded IF are just a portion of a longer formula.

In summary, is this possible to, in the middle of a formula, store something
in memory and recall it from memory for use in other places in the formula?

I think you'll say no, that's what VBA is for. That's ok, I just would like
to know for sure.

Thanks,

Harold


  #2   Report Post  
Posted to microsoft.public.excel.misc
Niek Otten
 
Posts: n/a
Default reducing the number of times an IF statement needs to be calculated in embedded IF statements

Hi Harold,

Use a separate cell for the intermediate result. Much easier testing too!

--
Kind regards,

Niek Otten

"Harold Good" wrote in message
...
Hi,

I have a long formula that is getting too long. It has 3 embedded IF
statements, with the logical test below having to be calculated each time.
(Planning!X14/365.25)+1900-INT((Planning!X14/365.25)+1900)

For example, when the logical test solves this to 2004, is there some way
to store that "2004" in memory the first time and recall it as "2004" in
the formula for the other two logical tests. Otherwise the formula is
getting so long, and these three embedded IF are just a portion of a
longer formula.

In summary, is this possible to, in the middle of a formula, store
something in memory and recall it from memory for use in other places in
the formula?

I think you'll say no, that's what VBA is for. That's ok, I just would
like to know for sure.

Thanks,

Harold



  #3   Report Post  
Posted to microsoft.public.excel.misc
Andrew Taylor
 
Posts: n/a
Default reducing the number of times an IF statement needs to be calculated in embedded IF statements

Harold,

Could you explain what you're trying to do with the formula? It
obviously involves some sort of manipulation of dates, and it may
be that you could simplify it by using Excel's built-in date functions.

To answer your original question, I'm pretty sure that it's not
possible to do what you ask within a worksheet function. A
simple way to avoid repetition and deep nesting is to add an
extra column or two to hold intermediate results, and hide
these columns if they spoil the presentation of the worksheet.

hth
Andrew Taylor


Harold Good wrote:
Hi,

I have a long formula that is getting too long. It has 3 embedded IF
statements, with the logical test below having to be calculated each time.
(Planning!X14/365.25)+1900-INT((Planning!X14/365.25)+1900)

For example, when the logical test solves this to 2004, is there some way to
store that "2004" in memory the first time and recall it as "2004" in the
formula for the other two logical tests. Otherwise the formula is getting so
long, and these three embedded IF are just a portion of a longer formula.

In summary, is this possible to, in the middle of a formula, store something
in memory and recall it from memory for use in other places in the formula?

I think you'll say no, that's what VBA is for. That's ok, I just would like
to know for sure.

Thanks,

Harold


  #4   Report Post  
Posted to microsoft.public.excel.misc
Harold Good
 
Posts: n/a
Default reducing the number of times an IF statement needs to be calculated in embedded IF statements

It has to do with a five digit number such as 20042, where the final digit
is the quarter. So I have to pull out the 2004 and do that formula. But like
you and others have suggested, storing this 2004 in a separate cell is a
simpler way to go.

Thanks,

Harold


"Andrew Taylor" wrote in message
oups.com...
Harold,

Could you explain what you're trying to do with the formula? It
obviously involves some sort of manipulation of dates, and it may
be that you could simplify it by using Excel's built-in date functions.

To answer your original question, I'm pretty sure that it's not
possible to do what you ask within a worksheet function. A
simple way to avoid repetition and deep nesting is to add an
extra column or two to hold intermediate results, and hide
these columns if they spoil the presentation of the worksheet.

hth
Andrew Taylor


Harold Good wrote:
Hi,

I have a long formula that is getting too long. It has 3 embedded IF
statements, with the logical test below having to be calculated each
time.
(Planning!X14/365.25)+1900-INT((Planning!X14/365.25)+1900)

For example, when the logical test solves this to 2004, is there some way
to
store that "2004" in memory the first time and recall it as "2004" in the
formula for the other two logical tests. Otherwise the formula is getting
so
long, and these three embedded IF are just a portion of a longer formula.

In summary, is this possible to, in the middle of a formula, store
something
in memory and recall it from memory for use in other places in the
formula?

I think you'll say no, that's what VBA is for. That's ok, I just would
like
to know for sure.

Thanks,

Harold




  #5   Report Post  
Posted to microsoft.public.excel.misc
Roger Govier
 
Posts: n/a
Default reducing the number of times an IF statement needs to be calculatedin embedded IF statements

Hi Harold

One way would be to use a cell say X1 to hold this calculation, then
reference $X$1 in your formula in place of the calculation.

Regards

Roger Govier


Harold Good wrote:
Hi,

I have a long formula that is getting too long. It has 3 embedded IF
statements, with the logical test below having to be calculated each time.
(Planning!X14/365.25)+1900-INT((Planning!X14/365.25)+1900)

For example, when the logical test solves this to 2004, is there some way to
store that "2004" in memory the first time and recall it as "2004" in the
formula for the other two logical tests. Otherwise the formula is getting so
long, and these three embedded IF are just a portion of a longer formula.

In summary, is this possible to, in the middle of a formula, store something
in memory and recall it from memory for use in other places in the formula?

I think you'll say no, that's what VBA is for. That's ok, I just would like
to know for sure.

Thanks,

Harold




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
How do I count the times a number occurs in a given criteria? w_aller Excel Discussion (Misc queries) 2 February 3rd 05 09:06 AM
Counting the number of times a word appears in a worksheet Jig Bhakta Excel Worksheet Functions 4 February 3rd 05 03:01 AM
How do I limit the number of times an Excel workbook can be opene. Chris Excel Discussion (Misc queries) 8 January 19th 05 04:02 PM
Can the number of times undo is used in Excel 2002 be increased? Austrian Hannes Setting up and Configuration of Excel 2 December 6th 04 05:54 PM
how do I get a calculation to repeat various number of times? weelittlekim Excel Worksheet Functions 1 October 27th 04 08:13 PM


All times are GMT +1. The time now is 03:06 PM.

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

About Us

"It's about Microsoft Excel"