Problem with excel

Solved/Closed
morpheusmp Posts 2 Registration date Tuesday 17 July 2012 Status Member Last seen 18 July 2012 - 17 Jul 2012 à 15:40
aquarelle Posts 7181 Registration date Saturday 7 April 2007 Status Moderator Last seen 14 February 2026 - 18 Jul 2012 à 09:40
Hello,

I was trying to write a formula in excel where IF A1 is greater than 7 then 1 would be substracted from it and if it is greater than 5 but less than or equal to 7 then .50 would be substracted from it. Can someone help me out with this formula. So far this is what I have but it does not do everything that I want. =IF(A2<=7,A2-0.5,IF(A2>7,A2-1,IF(A2>=5,A2+0.5)))

Regards
Related:

4 responses

aquarelle Posts 7181 Registration date Saturday 7 April 2007 Status Moderator Last seen 14 February 2026 491
17 Jul 2012 à 15:52
Hi,

Try like this :
=IF(A2>7,A2-1,IF(AND(A2>5,A2<=7),A2-0.5,A2+0.5))

Regards
Your formula doesn't work the way that I would like. Maybe I need to explain what I need better.

I need a formula that will let A2 stay the same if it is 5 or lower, if it is 5.25 to 7, .50 needs to be subtracted from it and if A2 is 7.25 or greater, 1 needs to subtracted from it.
aquarelle Posts 7181 Registration date Saturday 7 April 2007 Status Moderator Last seen 14 February 2026 491
17 Jul 2012 à 23:55
Hi,
Try this new one :
=IF(A2>7,A2-1,IF(AND(A2>5,A2<=7),A2-0.5,A2))

Regards
morpheusmp Posts 2 Registration date Tuesday 17 July 2012 Status Member Last seen 18 July 2012
18 Jul 2012 à 08:26
It works, thanks a lot. You have just made my life a lot easier.
aquarelle Posts 7181 Registration date Saturday 7 April 2007 Status Moderator Last seen 14 February 2026 491
18 Jul 2012 à 09:40
Happy to have been able to help you :)

Have nice day.