# Item1998: Spreadsheet Plugin $RIGHT() is broken

**Priority**: Urgent

**Current State:** Closed

**Released In:** 1.1.0

**Target Release:** minor

SpreadSheetPlugin $RIGHT() function is supposed to return the range of cells to the right of the current cell. Unfortunately, it returns cells to the left as well.

### Test of RIGHT:

**Col 3** below contains the expression: %CALC{"$SUM($RIGHT())"}%

The correct answers are 12 and 192. Apparently, RIGHT includes one column to the left as well.

### Test of LEFT:

**Col 3** below contains the expression: %CALC{"$SUM($LEFT())"}%

The correct answers above, are 3 and 48.

This works correctly.

### Suggestion

Enhance $RIGHT() and $LEFT() to accept a value which is the number of cells to the right or left to include. For example $LEFT(2) would include the two cells to the left and no more.

## PATCH

Attached trivial patch fixes this out by 2 error...

- Calc.diff: Patch to fix this trivial but very annoying bug

Note - made this urgent because it seems a pretty good idea to include such a trivial fix for such a complete breakage of functionality in the release.

--

DarrylGreen - 08 Aug 2010

Good move. Fix merged to trunk, thanks Darryl!

--

CrawfordCurrie - 09 Aug 2010