Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JaB JaB is offline
external usenet poster
 
Posts: 23
Default IF statement query

Hi

Im hoping someone can assist me in creating a formula that does the following.

I would like to look at cell A1 and if that cell contains a number greater
than 120, to return a figure of 10 for each increment of 30 over 120 but if
A1 contains a figure less than 120 it should return a figure of minus 10 for
each increment of 30 under 120. If the cell A1 is 0 then it should return a
0.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 459
Default IF statement query

JaB wrote:
Hi

Im hoping someone can assist me in creating a formula that does the
following.

I would like to look at cell A1 and if that cell contains a number
greater than 120, to return a figure of 10 for each increment of 30
over 120 but if A1 contains a figure less than 120 it should return a
figure of minus 10 for each increment of 30 under 120. If the cell
A1 is 0 then it should return a 0.

For instance;
A1=121 formula returns 10 , or,
A1=119 formula returns -10, or,
A1=211 formula returns 40 etc.

Any ideas?

Thanks


I think you could use a VLOOKUP function instead of IF: you have to build up
a search table and than you can use VOLOOKUP.


--
(I'm not sure of names of menus, options and commands, because
translating from the Italian version of Excel...)

Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default IF statement query

With your number in A1, this formula in B1 should do the trick:

=IF(A1<=0,0,IF(A1<=120,INT((A1-120)/30)*10,(INT((A1-120)/30)+1)*10))

Negative values in A1 are treated the same as zero, and this also
returns a zero if A1 is 120. Copy down column B if you have other
values in column A that you want this to apply to.

Hope this helps.

Pete

JaB wrote:
Hi

Im hoping someone can assist me in creating a formula that does the following.

I would like to look at cell A1 and if that cell contains a number greater
than 120, to return a figure of 10 for each increment of 30 over 120 but if
A1 contains a figure less than 120 it should return a figure of minus 10 for
each increment of 30 under 120. If the cell A1 is 0 then it should return a
0.

For instance;
A1=121 formula returns 10 , or,
A1=119 formula returns -10, or,
A1=211 formula returns 40 etc.

Any ideas?

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default IF statement query

Just stick a - before the IF

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"JaB" wrote in message
...
Thanks Pete.

I realised that I had the criteria back to front. I should have said for
every increment of 30 over 120 the formula should return minus 10, and for
every increment of 30 under 120 the formula should add 10. How does this
alter the formula?

Thanks

"Pete_UK" wrote:

With your number in A1, this formula in B1 should do the trick:

=IF(A1<=0,0,IF(A1<=120,INT((A1-120)/30)*10,(INT((A1-120)/30)+1)*10))

Negative values in A1 are treated the same as zero, and this also
returns a zero if A1 is 120. Copy down column B if you have other
values in column A that you want this to apply to.

Hope this helps.

Pete

JaB wrote:
Hi

Im hoping someone can assist me in creating a formula that does the

following.

I would like to look at cell A1 and if that cell contains a number

greater
than 120, to return a figure of 10 for each increment of 30 over 120

but if
A1 contains a figure less than 120 it should return a figure of minus

10 for
each increment of 30 under 120. If the cell A1 is 0 then it should

return a
0.

For instance;
A1=121 formula returns 10 , or,
A1=119 formula returns -10, or,
A1=211 formula returns 40 etc.

Any ideas?

Thanks





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default IF statement query

OK, Bob, mine was the second easiest way! <bg

Pete

Bob Phillips wrote:
Just stick a - before the IF

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"JaB" wrote in message
...
Thanks Pete.

I realised that I had the criteria back to front. I should have said for
every increment of 30 over 120 the formula should return minus 10, and for
every increment of 30 under 120 the formula should add 10. How does this
alter the formula?

Thanks

"Pete_UK" wrote:

With your number in A1, this formula in B1 should do the trick:

=IF(A1<=0,0,IF(A1<=120,INT((A1-120)/30)*10,(INT((A1-120)/30)+1)*10))

Negative values in A1 are treated the same as zero, and this also
returns a zero if A1 is 120. Copy down column B if you have other
values in column A that you want this to apply to.

Hope this helps.

Pete

JaB wrote:
Hi

Im hoping someone can assist me in creating a formula that does the

following.

I would like to look at cell A1 and if that cell contains a number

greater
than 120, to return a figure of 10 for each increment of 30 over 120

but if
A1 contains a figure less than 120 it should return a figure of minus

10 for
each increment of 30 under 120. If the cell A1 is 0 then it should

return a
0.

For instance;
A1=121 formula returns 10 , or,
A1=119 formula returns -10, or,
A1=211 formula returns 40 etc.

Any ideas?

Thanks





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default IF statement query

Too many late-nights <ebg

Bob

"Pete_UK" wrote in message
ups.com...
OK, Bob, mine was the second easiest way! <bg

Pete

Bob Phillips wrote:
Just stick a - before the IF

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"JaB" wrote in message
...
Thanks Pete.

I realised that I had the criteria back to front. I should have said

for
every increment of 30 over 120 the formula should return minus 10, and

for
every increment of 30 under 120 the formula should add 10. How does

this
alter the formula?

Thanks

"Pete_UK" wrote:

With your number in A1, this formula in B1 should do the trick:

=IF(A1<=0,0,IF(A1<=120,INT((A1-120)/30)*10,(INT((A1-120)/30)+1)*10))

Negative values in A1 are treated the same as zero, and this also
returns a zero if A1 is 120. Copy down column B if you have other
values in column A that you want this to apply to.

Hope this helps.

Pete

JaB wrote:
Hi

Im hoping someone can assist me in creating a formula that does

the
following.

I would like to look at cell A1 and if that cell contains a number

greater
than 120, to return a figure of 10 for each increment of 30 over

120
but if
A1 contains a figure less than 120 it should return a figure of

minus
10 for
each increment of 30 under 120. If the cell A1 is 0 then it

should
return a
0.

For instance;
A1=121 formula returns 10 , or,
A1=119 formula returns -10, or,
A1=211 formula returns 40 etc.

Any ideas?

Thanks





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
Problems importing from an Access query Mike Excel Discussion (Misc queries) 0 June 20th 06 09:35 PM
changing query source [email protected] Excel Worksheet Functions 2 March 21st 06 08:55 PM
AHHH! Again JAA149 Excel Discussion (Misc queries) 0 October 31st 05 11:36 AM
AHHHH-Get Data from Multiple Excel workbooks JAA149 Excel Discussion (Misc queries) 5 October 30th 05 05:19 PM
"Query cannot be edited by the Query Wizard" PancakeBatter Excel Discussion (Misc queries) 0 April 25th 05 05:59 PM


All times are GMT +1. The time now is 09:53 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"