Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Formula Programming

I want to programme so that if C6 is between 1 and 4 then the answer is Sum
of C45 and C46, if C6 is between 5 and 8 then the answer is sum of C45 and
C46(X2), if the C6 is between 9 and 12 then the answer is sum of C45 and
C46(X3)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Formula Programming

Try:-

=IF(AND(C6=1,C6<=4),C45+C46,IF(AND(C6=5,C6<=8),C 45+(C46*2),IF(AND(C6=9,C6<=12),C45+(C46*3),"Out of range")))

Mike

"Foghat" wrote:

I want to programme so that if C6 is between 1 and 4 then the answer is Sum
of C45 and C46, if C6 is between 5 and 8 then the answer is sum of C45 and
C46(X2), if the C6 is between 9 and 12 then the answer is sum of C45 and
C46(X3)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Formula Programming

=IF(AND(C6=1,C6<=4),C45+C46,IF(AND(C64,C6<=8),C4 5+C46*2,IF(AND(C68,C6<=12),C45+C46*3,"")))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Foghat" wrote in message
...
I want to programme so that if C6 is between 1 and 4 then the answer is Sum
of C45 and C46, if C6 is between 5 and 8 then the answer is sum of C45 and
C46(X2), if the C6 is between 9 and 12 then the answer is sum of C45 and
C46(X3)



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Formula Programming

I want to programme so that if C6 is between 1 and 4 then the answer is Sum
of C45 and C46, if C6 is between 5 and 8 then the answer is sum of C45 and
C46(X2), if the C6 is between 9 and 12 then the answer is sum of C45 and
C46(X3)


Assuming C6 will only contain integer values...

=IF(C6<1,"Out of
range",IF(C6<5,C45+C46,IF(C6<9,C45+(C46*2),IF(C6<1 3,C45+(C46*3),"Out of
range"))))

If C6 can contain floating point numbers, then you have some holes in your
original specification and need to clarify what happens between 4 and 5 as
well as 8 and 9.

Rick

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Formula Programming

Many thanks Rick, this is a formula which will be whole numbers only

Regards

Craig

"Rick Rothstein (MVP - VB)" wrote:

I want to programme so that if C6 is between 1 and 4 then the answer is Sum
of C45 and C46, if C6 is between 5 and 8 then the answer is sum of C45 and
C46(X2), if the C6 is between 9 and 12 then the answer is sum of C45 and
C46(X3)


Assuming C6 will only contain integer values...

=IF(C6<1,"Out of
range",IF(C6<5,C45+C46,IF(C6<9,C45+(C46*2),IF(C6<1 3,C45+(C46*3),"Out of
range"))))

If C6 can contain floating point numbers, then you have some holes in your
original specification and need to clarify what happens between 4 and 5 as
well as 8 and 9.

Rick




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Formula Programming

Many thanks Bob that really helped

I have one other problem which should enable me to complete this spreadsheet
if you could help

Here goes

If C18 is between 1 and 4 and C6 is between 1 and 4 then the answer is C48,
If C18 is between 5 and 8 and C6 is between 1 and 4 then the answer is C48x2
if C18 is between 9 and 12 and C6 is between 1 and 4 then the answer is C48 X
3 +C45

there are alot of different variables in this spreadsheet so I dont know if
this is the right way to be doing it or is there another way which it can be
done

Many thanks in advance for everyones help

Craig



"Bob Phillips" wrote:

=IF(AND(C6=1,C6<=4),C45+C46,IF(AND(C64,C6<=8),C4 5+C46*2,IF(AND(C68,C6<=12),C45+C46*3,"")))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Foghat" wrote in message
...
I want to programme so that if C6 is between 1 and 4 then the answer is Sum
of C45 and C46, if C6 is between 5 and 8 then the answer is sum of C45 and
C46(X2), if the C6 is between 9 and 12 then the answer is sum of C45 and
C46(X3)




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Formula Programming

what if C6 is not between 1 and 4 in each instance of C18?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Foghat" wrote in message
...
Many thanks Bob that really helped

I have one other problem which should enable me to complete this
spreadsheet
if you could help

Here goes

If C18 is between 1 and 4 and C6 is between 1 and 4 then the answer is
C48,
If C18 is between 5 and 8 and C6 is between 1 and 4 then the answer is
C48x2
if C18 is between 9 and 12 and C6 is between 1 and 4 then the answer is
C48 X
3 +C45

there are alot of different variables in this spreadsheet so I dont know
if
this is the right way to be doing it or is there another way which it can
be
done

Many thanks in advance for everyones help

Craig



"Bob Phillips" wrote:

=IF(AND(C6=1,C6<=4),C45+C46,IF(AND(C64,C6<=8),C4 5+C46*2,IF(AND(C68,C6<=12),C45+C46*3,"")))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Foghat" wrote in message
...
I want to programme so that if C6 is between 1 and 4 then the answer is
Sum
of C45 and C46, if C6 is between 5 and 8 then the answer is sum of C45
and
C46(X2), if the C6 is between 9 and 12 then the answer is sum of C45
and
C46(X3)






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Formula Programming

It always will have a number between 1 and 12 but was going to see how i got
on with the answer and then expand it if i could (didn't want to be taking
the mickey and seem as if you were doing all the work for me)

Many thanks

CRaig

"Foghat" wrote:

Many thanks Bob that really helped

I have one other problem which should enable me to complete this spreadsheet
if you could help

Here goes

If C18 is between 1 and 4 and C6 is between 1 and 4 then the answer is C48,
If C18 is between 5 and 8 and C6 is between 1 and 4 then the answer is C48x2
if C18 is between 9 and 12 and C6 is between 1 and 4 then the answer is C48 X
3 +C45

there are alot of different variables in this spreadsheet so I dont know if
this is the right way to be doing it or is there another way which it can be
done

Many thanks in advance for everyones help

Craig



"Bob Phillips" wrote:

=IF(AND(C6=1,C6<=4),C45+C46,IF(AND(C64,C6<=8),C4 5+C46*2,IF(AND(C68,C6<=12),C45+C46*3,"")))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Foghat" wrote in message
...
I want to programme so that if C6 is between 1 and 4 then the answer is Sum
of C45 and C46, if C6 is between 5 and 8 then the answer is sum of C45 and
C46(X2), if the C6 is between 9 and 12 then the answer is sum of C45 and
C46(X3)




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Formula Programming

We are use to that <G

=IF(AND(C6=1,C6<=4),IF(C18<1,"oops!",IF(C18<5,C48 ,IF(C18<9,C48*2,IF(C18<13,C48*3,"oops
again!")))),"")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Foghat" wrote in message
...
It always will have a number between 1 and 12 but was going to see how i
got
on with the answer and then expand it if i could (didn't want to be taking
the mickey and seem as if you were doing all the work for me)

Many thanks

CRaig

"Foghat" wrote:

Many thanks Bob that really helped

I have one other problem which should enable me to complete this
spreadsheet
if you could help

Here goes

If C18 is between 1 and 4 and C6 is between 1 and 4 then the answer is
C48,
If C18 is between 5 and 8 and C6 is between 1 and 4 then the answer is
C48x2
if C18 is between 9 and 12 and C6 is between 1 and 4 then the answer is
C48 X
3 +C45

there are alot of different variables in this spreadsheet so I dont know
if
this is the right way to be doing it or is there another way which it can
be
done

Many thanks in advance for everyones help

Craig



"Bob Phillips" wrote:

=IF(AND(C6=1,C6<=4),C45+C46,IF(AND(C64,C6<=8),C4 5+C46*2,IF(AND(C68,C6<=12),C45+C46*3,"")))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Foghat" wrote in message
...
I want to programme so that if C6 is between 1 and 4 then the answer
is Sum
of C45 and C46, if C6 is between 5 and 8 then the answer is sum of
C45 and
C46(X2), if the C6 is between 9 and 12 then the answer is sum of C45
and
C46(X3)





  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Formula Programming

Hi Bob

Many thanks for your help so far, i have one last query (I think it will be
the last anyway as I get the general idea now)

Here goes

If C18 is between 1 and 4 and C6 is between 1 and 4 then the answer is C48,
If C18 is between 5 and 8 and C6 is between 1 and 4 then the answer is C48x2
if C18 is between 9 and 12 and C6 is between 1 and 4 then the answer is C48 X
3 +C45 This is what you did last time) then i want to add
If C18 is between 1 and 4 and C6 is between 5 and 8 then the answer isC48
If C18 is between 5 and 8 and C6 is between 5 and 8 then the answer is
C48*2+C45
If C18 is between 9 and 12 and C6 is between 5 and 8 then the answer is
C48*3 + C45

Many thanks

Craig



"Bob Phillips" wrote:

We are use to that <G

=IF(AND(C6=1,C6<=4),IF(C18<1,"oops!",IF(C18<5,C48 ,IF(C18<9,C48*2,IF(C18<13,C48*3,"oops
again!")))),"")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Foghat" wrote in message
...
It always will have a number between 1 and 12 but was going to see how i
got
on with the answer and then expand it if i could (didn't want to be taking
the mickey and seem as if you were doing all the work for me)

Many thanks

CRaig

"Foghat" wrote:

Many thanks Bob that really helped

I have one other problem which should enable me to complete this
spreadsheet
if you could help

Here goes

If C18 is between 1 and 4 and C6 is between 1 and 4 then the answer is
C48,
If C18 is between 5 and 8 and C6 is between 1 and 4 then the answer is
C48x2
if C18 is between 9 and 12 and C6 is between 1 and 4 then the answer is
C48 X
3 +C45

there are alot of different variables in this spreadsheet so I dont know
if
this is the right way to be doing it or is there another way which it can
be
done

Many thanks in advance for everyones help

Craig



"Bob Phillips" wrote:

=IF(AND(C6=1,C6<=4),C45+C46,IF(AND(C64,C6<=8),C4 5+C46*2,IF(AND(C68,C6<=12),C45+C46*3,"")))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Foghat" wrote in message
...
I want to programme so that if C6 is between 1 and 4 then the answer
is Sum
of C45 and C46, if C6 is between 5 and 8 then the answer is sum of
C45 and
C46(X2), if the C6 is between 9 and 12 then the answer is sum of C45
and
C46(X3)








  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Formula Programming

If C18 is between 1 and 4 and C6 is between 1 and 4 then the answer is
C48,
If C18 is between 5 and 8 and C6 is between 1 and 4 then the answer is
C48x2


Just checking to make sure you don't have a typo in the above "answer"
condition... is it correct as typed or was it supposed to have been
C48x2+C45? I ask because first and third answers for C6 between 1 and 4 as
well as for C6 between 5 and 8 are the same AND the only difference in the
answer between these two groups for the second C6 condition is in the
addition of C45, which looked suspicious to me, so I thought I would check.

Rick

if C18 is between 9 and 12 and C6 is between 1 and 4 then the answer is
C48 X
3 +C45 This is what you did last time) then i want to add
If C18 is between 1 and 4 and C6 is between 5 and 8 then the answer isC48
If C18 is between 5 and 8 and C6 is between 5 and 8 then the answer is
C48*2+C45
If C18 is between 9 and 12 and C6 is between 5 and 8 then the answer is
C48*3 + C45



  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Formula Programming

Hi rick

Many thanks for your reply
The original is correct i have double checked it

Regards

Craig

"Rick Rothstein (MVP - VB)" wrote:

If C18 is between 1 and 4 and C6 is between 1 and 4 then the answer is
C48,
If C18 is between 5 and 8 and C6 is between 1 and 4 then the answer is
C48x2


Just checking to make sure you don't have a typo in the above "answer"
condition... is it correct as typed or was it supposed to have been
C48x2+C45? I ask because first and third answers for C6 between 1 and 4 as
well as for C6 between 5 and 8 are the same AND the only difference in the
answer between these two groups for the second C6 condition is in the
addition of C45, which looked suspicious to me, so I thought I would check.

Rick

if C18 is between 9 and 12 and C6 is between 1 and 4 then the answer is
C48 X
3 +C45 This is what you did last time) then i want to add
If C18 is between 1 and 4 and C6 is between 5 and 8 then the answer isC48
If C18 is between 5 and 8 and C6 is between 5 and 8 then the answer is
C48*2+C45
If C18 is between 9 and 12 and C6 is between 5 and 8 then the answer is
C48*3 + C45




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
Excel - Formula/Programming Ezra[_2_] Excel Worksheet Functions 1 May 19th 08 08:08 PM
Excel Formula / Programming Theresa Excel Discussion (Misc queries) 3 December 18th 07 05:00 AM
Programming a simple formula anagaraj1 New Users to Excel 1 August 4th 05 03:32 PM
Programming A formula Joseph[_42_] Excel Programming 1 September 28th 04 05:22 PM
Programming A formula Joseph[_41_] Excel Programming 2 September 28th 04 04:36 PM


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