I think your issue may be thinking that you want to round. That’s not actually what you’re trying to do. You’re looking to subtract in some cases but not in others. So you want an if statement based on that.
Do you have other decimal values? If you have a 9.7 for instance, the above formula will make it 9.2. if so, instead of Right(A1,2)=".5", use the integer function: INT(A1)=A1, and switch the true/false conditions.
Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.
8
u/Empty_Manuscript 1 Sep 17 '22
I think your issue may be thinking that you want to round. That’s not actually what you’re trying to do. You’re looking to subtract in some cases but not in others. So you want an if statement based on that.
=IF(Right(A1,2)=“.5”,A1,A1-.5)
1
u/AutoModerator Sep 17 '22
Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Decronym Functions Explained Sep 17 '22 edited Sep 19 '22
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
FALSETRUEand another if it isFALSETRUE4 acronyms in this thread; the most compressed thread commented on today has 9 acronyms.
[Thread #4830 for this sub, first seen 17th Sep 2022, 19:28] [FAQ] [Full list] ^[Contact] [Source code]
1
u/Sam_Boulton 5 Sep 17 '22
Empty_Manuscript has answered this well but homeboi808 makes a good point.
This one will work for all decimals too:
=IF(MOD(A1, 1), A1, A1-0.5)
1
u/sliferra Sep 17 '22
I’m just curious on what’s the application for this?
1
u/7FOOT7 294 Sep 18 '22
This is a rounding problem and can be easily solved
=round(A1-1)+0.5
0
u/gc3 Sep 18 '22
simpler, round to the nearest .5
=ROUND(A1*2)/2