Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
ramana
 
Posts: n/a
Default need a conditional formula to generate numbers divisible by 4 between a given starting no. & end No.

Hi everybody,


I need a conditional formula that returns the values(numbers)
divisible by 4 and also that gives the strating value in the first cell
and ending value in the last cell irrespective whether the first & last
numbers are divisible by 4.

Here I'm giving two example for better understanding.

Ex1: Cell A1 = 1(starting number)
Cell B1 = 49(ending number)
Now I want apply formula in column C so that Cell C1 should return a
value 1(starting number),i.e. c1=1,
C2=4,C3=8,c4=12,c5=16,c6=20,c7=24,c8=28,c9=32,c10= 36,c11=40,c12=44,c13=48
& c14=49(ending number).

Ex2: cell A1 = 199
Cell b1 = 345
Then the result should be C1=199(starting
number),c2=200,c3=204,c4=208,c5=212,c6=216...divis ibles of 4.....then
the last cell = 345(ending number).

Hope that the question & examples are clear.

Pl. can any body help me to write a conditional formula for this
problem.

Regards

Ramana

  #2   Report Post  
Rowan Drummond
 
Posts: n/a
Default need a conditional formula to generate numbers divisible by 4between a given starting no. & end No.

In C1 enter:

=IF(ROWS($1:1)=1,$A$1,IF(FLOOR($A$1+((ROWS($1:1)-1)*4),4)<$B$1,FLOOR($A$1+((ROWS($1:1)-1)*4),4),IF(FLOOR($A$1+((ROWS($1:1)-1)*4),4)<$B$1+4,$B$1,"")))

and copy down as required.

Hope this helps
Rwoan

ramana wrote:
Hi everybody,


I need a conditional formula that returns the values(numbers)
divisible by 4 and also that gives the strating value in the first cell
and ending value in the last cell irrespective whether the first & last
numbers are divisible by 4.

Here I'm giving two example for better understanding.

Ex1: Cell A1 = 1(starting number)
Cell B1 = 49(ending number)
Now I want apply formula in column C so that Cell C1 should return a
value 1(starting number),i.e. c1=1,
C2=4,C3=8,c4=12,c5=16,c6=20,c7=24,c8=28,c9=32,c10= 36,c11=40,c12=44,c13=48
& c14=49(ending number).

Ex2: cell A1 = 199
Cell b1 = 345
Then the result should be C1=199(starting
number),c2=200,c3=204,c4=208,c5=212,c6=216...divis ibles of 4.....then
the last cell = 345(ending number).

Hope that the question & examples are clear.

Pl. can any body help me to write a conditional formula for this
problem.

Regards

Ramana

  #3   Report Post  
ramana
 
Posts: n/a
Default need a conditional formula to generate numbers divisible by 4 between a given starting no. & end No.

Hi Rowan,

Thanks for the solution you have given. Its working partially. when
copy down the formula to the other cells it is displaying the starting
number in all the cells. but when I save the document then it is
displaying the required numbers. But I coudn't understand why it is not
displaying the required values untill unless we save the document. I
need insert this formula in a column where there are many other
formulas in the other columns and they change dynamically by the input
values even I don't save the document. Can you or anybody solve this
problem.

Thanks & Regards

Ramana

  #4   Report Post  
Rowan Drummond
 
Posts: n/a
Default need a conditional formula to generate numbers divisible by 4between a given starting no. & end No.

Hi Ramana

Check your calculation setting. ToolsOptionsCalculation. It sounds
like it is set to Manual. Change that to Automatic.

Regards
Rowan

ramana wrote:
Hi Rowan,

Thanks for the solution you have given. Its working partially. when
copy down the formula to the other cells it is displaying the starting
number in all the cells. but when I save the document then it is
displaying the required numbers. But I coudn't understand why it is not
displaying the required values untill unless we save the document. I
need insert this formula in a column where there are many other
formulas in the other columns and they change dynamically by the input
values even I don't save the document. Can you or anybody solve this
problem.

Thanks & Regards

Ramana

  #5   Report Post  
ramana
 
Posts: n/a
Default need a conditional formula to generate numbers divisible by 4 between a given starting no. & end No.

Thankyou Rowan, Its now working, the calculation setting was in manual
because there is macro in my workbook, where it says
application.calculation = manual, so when ever I runthe marcro it is
going to manual mode. Now my problem is solved.

Thanks and Regards

Ramana



  #6   Report Post  
Rowan Drummond
 
Posts: n/a
Default need a conditional formula to generate numbers divisible by 4between a given starting no. & end No.

You're welcome.

Maybe you should add the line of code:
Application.Calculation = xlCalculationAutomatic
at the end of your macro.

Regards
Rowan

ramana wrote:
Thankyou Rowan, Its now working, the calculation setting was in manual
because there is macro in my workbook, where it says
application.calculation = manual, so when ever I runthe marcro it is
going to manual mode. Now my problem is solved.

Thanks and Regards

Ramana

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
Conditional formula - language needed gamebird Excel Worksheet Functions 7 October 10th 05 11:48 PM
conditional formatting based on another cells formula result kstarkey Excel Discussion (Misc queries) 3 October 5th 05 09:07 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
generate consecutive numbers Mark New Users to Excel 6 March 15th 05 06:45 PM


All times are GMT +1. The time now is 07:46 AM.

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"