Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
PH
 
Posts: n/a
Default Help with "IF" Formula

I need help in writing a If formula (at least I think that is what I need) in
excel. This is what I need:
If (a1)cell=6, then (g1)cell-1, IF(a1)cell=5.5, then cell-2, and so on down
to if cell=3, then cell-7, if false for all then enter (g1)cell. I need to
do this also from cell=7 then cell+1 up to cell=8.5, then +4. Can I have
that many if statements? I can get it to work with one no more. Example
=IF(F3=6,(J3-1),J3), this works. this doesn't
=IF(F3=6,(J3-1),J3)=IF(F3=5.5,(J3-2),J3) Thanks

  #2   Report Post  
Ian
 
Posts: n/a
Default

You can do this without a bunch of IFs as this is a logical progression. If
I understand correctly, you want to offset the value in J3 by 1 for each 0.5
variation in F3 from 6.5. You can do this with J3+((F3-6.5)*2). You appear
to want a false statement returned if F3 is not between 3 & 8.5 and you can
test for this with AND(F3=3,F3<=8.5).

Putting this into a formula we get

=IF(AND(F3=3,F3<=8.5),J3+((F3-6.5)*2),"false statement")

You wouldn't have been able to do it the way you were trying because you can
only have 7 nested IFs.
--
Ian
--
"PH" wrote in message
...
I need help in writing a If formula (at least I think that is what I need)
in
excel. This is what I need:
If (a1)cell=6, then (g1)cell-1, IF(a1)cell=5.5, then cell-2, and so on
down
to if cell=3, then cell-7, if false for all then enter (g1)cell. I need
to
do this also from cell=7 then cell+1 up to cell=8.5, then +4. Can I have
that many if statements? I can get it to work with one no more. Example
=IF(F3=6,(J3-1),J3), this works. this doesn't
=IF(F3=6,(J3-1),J3)=IF(F3=5.5,(J3-2),J3) Thanks



  #3   Report Post  
PH
 
Posts: n/a
Default

Thanks Ian, but I am not quite sure if this is exactly what I am wanting. I
will try to explain better. You are correct that I want to add 1 per.5 but
that is if the numbers are between 2 and 6. If the number is between 6.5 and
9 I need to subtract 1 for every .5. Does this make sense. If it is 6.5
then it stays the value. I understand what I need to do now better so I will
work on it but if you can help I will greatly appreciate it.

"Ian" wrote:

You can do this without a bunch of IFs as this is a logical progression. If
I understand correctly, you want to offset the value in J3 by 1 for each 0.5
variation in F3 from 6.5. You can do this with J3+((F3-6.5)*2). You appear
to want a false statement returned if F3 is not between 3 & 8.5 and you can
test for this with AND(F3=3,F3<=8.5).

Putting this into a formula we get

=IF(AND(F3=3,F3<=8.5),J3+((F3-6.5)*2),"false statement")

You wouldn't have been able to do it the way you were trying because you can
only have 7 nested IFs.
--
Ian
--
"PH" wrote in message
...
I need help in writing a If formula (at least I think that is what I need)
in
excel. This is what I need:
If (a1)cell=6, then (g1)cell-1, IF(a1)cell=5.5, then cell-2, and so on
down
to if cell=3, then cell-7, if false for all then enter (g1)cell. I need
to
do this also from cell=7 then cell+1 up to cell=8.5, then +4. Can I have
that many if statements? I can get it to work with one no more. Example
=IF(F3=6,(J3-1),J3), this works. this doesn't
=IF(F3=6,(J3-1),J3)=IF(F3=5.5,(J3-2),J3) Thanks




  #4   Report Post  
Ian
 
Posts: n/a
Default

Hi PH

Sorry for the delay in replying but I've been on holiday.

I got your offset the wrong way round. My original formula added for higher
numbers.

If I understand correctly, F3 at 7 should give J3-1 and at 6 should be J3+1.
You also need the operating limits to be 2 and 9

Try this:

=IF(AND(F3=2,F3<=9),J3+((6.5-F3)*2),"false statement")

All I have done is altered the limits in the first part of the formula (the
AND argument) and reversed the 6.5 and F3 the the next part.

--
Ian
--
"PH" wrote in message
...
Thanks Ian, but I am not quite sure if this is exactly what I am wanting.
I
will try to explain better. You are correct that I want to add 1 per.5 but
that is if the numbers are between 2 and 6. If the number is between 6.5
and
9 I need to subtract 1 for every .5. Does this make sense. If it is 6.5
then it stays the value. I understand what I need to do now better so I
will
work on it but if you can help I will greatly appreciate it.

"Ian" wrote:

You can do this without a bunch of IFs as this is a logical progression.
If
I understand correctly, you want to offset the value in J3 by 1 for each
0.5
variation in F3 from 6.5. You can do this with J3+((F3-6.5)*2). You
appear
to want a false statement returned if F3 is not between 3 & 8.5 and you
can
test for this with AND(F3=3,F3<=8.5).

Putting this into a formula we get

=IF(AND(F3=3,F3<=8.5),J3+((F3-6.5)*2),"false statement")

You wouldn't have been able to do it the way you were trying because you
can
only have 7 nested IFs.
--
Ian
--
"PH" wrote in message
...
I need help in writing a If formula (at least I think that is what I
need)
in
excel. This is what I need:
If (a1)cell=6, then (g1)cell-1, IF(a1)cell=5.5, then cell-2, and so on
down
to if cell=3, then cell-7, if false for all then enter (g1)cell. I
need
to
do this also from cell=7 then cell+1 up to cell=8.5, then +4. Can I
have
that many if statements? I can get it to work with one no more.
Example
=IF(F3=6,(J3-1),J3), this works. this doesn't
=IF(F3=6,(J3-1),J3)=IF(F3=5.5,(J3-2),J3) 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
referencing named formula using INDIRECT function [email protected] Excel Worksheet Functions 19 May 11th 05 09:48 AM
Simplify formula Luke Excel Worksheet Functions 37 May 6th 05 07:21 AM
put formula results into a different cell if it is empty PutFormula Excel Worksheet Functions 2 February 11th 05 03:31 AM
how do i write a formula and keep in in formula form, so it DOESN. norcalchick2207 Excel Discussion (Misc queries) 2 February 4th 05 08:38 PM
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 04:37 PM


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