Formula Help

Discuss the spreadsheet application
Post Reply
BillLillard
Posts: 3
Joined: Wed Nov 22, 2017 1:42 am

Formula Help

Post by BillLillard »

Hey guys, I'm not well versed with this software, so please don't mind my ignorance to how it works. Most of what I've needed to figure out I've been able to google and put together, but I'm stumped on getting it to do one thing.

I need an input number to convert to another number. I would like to make these conversions:

5 to 5
4.5 to 4
4.0 to 3
3.5 to 2
3.0 to 1
2.5 to -1
2.0 to -2
1.5 to -3
1.0 to -4
0.5 to -5

So if I enter a 2 in one cell, the next cell over will spit out -2, accordingly. Is this easily doable?

Thanks in advance for any help.
Bill
OpenOffice 4.1.2 on Windows 10
User avatar
robleyd
Moderator
Posts: 5087
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Formula Help

Post by robleyd »

G'day, and welcome to the community forum.

Have a look at the VLOOKUP() function.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Formula Help

Post by Villeroy »

You should be clear about the return value for any other number. What about 999, 13, 4.1, 3.2, -13 to mention a few ?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
keme
Volunteer
Posts: 3705
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Formula Help

Post by keme »

This will output what you ask for, assuming that your input cell is A1.

Code: Select all

=2*A1-5-IF(A1<=2.5;1;0)
Beware of invalid input. Cf. Villeroy's advice above.
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Formula Help

Post by Lupp »

In addition to the comment by Villeroy I would dare to suggest that the OQ checks again if not the omission of a zero result is a logical error. Generally scales allowing for both positive and negative values have also a point zero. The numbering of years on a historical time scale should be regarded an inglorious exception, historic but outdated.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Post Reply