[Solved-Workaround] Referencing a value in a cell
[Solved-Workaround] Referencing a value in a cell
Apologies if this has been asked before.
I have a multi page spread sheet. One column consists of either "Y" or "N". For each page, I add Y and N values for that page and display it in a "total" cell (Y=31 N=12). I also want to display the cumulative Y & N values. This requires referencing the cumulative values from the previous page. How do I reference the numerical value (e.g. 31 in above example) in a cell with text?
I have a multi page spread sheet. One column consists of either "Y" or "N". For each page, I add Y and N values for that page and display it in a "total" cell (Y=31 N=12). I also want to display the cumulative Y & N values. This requires referencing the cumulative values from the previous page. How do I reference the numerical value (e.g. 31 in above example) in a cell with text?
Last edited by Hagar Delest on Mon Apr 03, 2017 5:47 pm, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
OpenOffice 4.1 on Windows 8.1
Re: referencing a value in a cell
I have a cell :
I have another cell:
I want to add the "Y" values and "N" values of these cells together and display this in the same way. I ultimately want to do this for 100 cells so it doesn't make sense to keep adding code.
Code: Select all
="Y="&COUNTIF(AS2:AS28;"Y")&" N="&COUNTIF(AS2:AS28;"N")
Code: Select all
="Y="&COUNTIF(BX2:BX28;"Y")&" N="&COUNTIF(BX2:BX28;"N")
OpenOffice 4.1 on Windows 8.1
Re: referencing a value in a cell
May I suppose you displayed two numeric values in one cell on the sheets concernd using formulas likeleeelson wrote:For each page, I add Y and N values for that page and display it in a "total" cell (Y=31 N=12).
Code: Select all
=COUNTIF(Sheet1.A2:A40;"Y")&"Y, "&COUNTIF(Sheet1.A2:A40;"N")&"N"
If so, this is gravely against the grain in spreadsheets.
(Editing: A meanwhile crossed in post cleared this.)
The only way to get a total across sheets without referencing every cell you want to include expressly, is to use SUM applied to a so called cuboid like in
Code: Select all
SUM(MyStartingSheet.A1:MyFinalSheet.A1)
My advice:
1) Preferably redesign your sheets without splitting data you want to evaluate together into multiple sheets.
2) If you can't observe this advice for some urgent reason, dedicate per sheet one cell to the number of "Y" and one cell to the number of "N", and add these pure numbers on your survey sheet using the above "SUM(cuboid)" construct.
(Editing again:)
I don't understand this. What do you mean by "keep adding code"?leeelson wrote:... so it doesn't make sense to keep adding code.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: referencing a value in a cell
Thanks for your input!
1) So if I don't double up, e.g.
then
doesn't seem to be able to interpret what is there since it is not purely a number and it can't make sense of summing text.
2) The cells which I want to sum do not appear in the same place on each sheet, hence I would have to spell out each cell on each sheet as my sheet list grows larger.
Is there any way to pick the numerical value part of a cell without the text? (e.g. 23 in a result that is N=23)
but after 100 sheets this gets pretty cumbersome.
I see 2 problems with this:Lupp wrote:
The only way to get a total across sheets without referencing every cell you want to include expressly, is to use SUM applied to a so called cuboid like inCode: Select all
SUM(MyStartingSheet.A1:MyFinalSheet.A1)
1) So if I don't double up, e.g.
Code: Select all
="Y="&COUNTIF(BX2:BX28;"Y")
Code: Select all
SUM((MyStartingSheet.A1:MyFinalSheet.A1)
2) The cells which I want to sum do not appear in the same place on each sheet, hence I would have to spell out each cell on each sheet as my sheet list grows larger.
Is there any way to pick the numerical value part of a cell without the text? (e.g. 23 in a result that is N=23)
Well one way to do this is to explicity sum the cells on each sheet and add them together:Lupp wrote:I don't understand this. What do you mean by "keep adding code"?leeelson wrote:... so it doesn't make sense to keep adding code.
Code: Select all
="Y=" &(COUNTIF(Sheet4.O3:Sheet4.O28;"Y")+COUNTIF(Sheet3.O3:Sheet3.O30;"Y")+COUNTIF(Sheet2.O3:Sheet2.O33;"Y")+COUNTIF(P3:P28;"Y"))
OpenOffice 4.1 on Windows 8.1
Re: referencing a value in a cell
Tryleeelson wrote:I have a cell :I have another cell:Code: Select all
="Y="&COUNTIF(AS2:AS28;"Y")&" N="&COUNTIF(AS2:AS28;"N")
I want to add the "Y" values and "N" values of these cells together and display this in the same way. I ultimately want to do this for 100 cells so it doesn't make sense to keep adding code.Code: Select all
="Y="&COUNTIF(BX2:BX28;"Y")&" N="&COUNTIF(BX2:BX28;"N")
Code: Select all
="Y="&countifs(AS2:AS28;"Y";BX2:BX28;"Y")&" N="&countifs(AS2:AS28;"N";BX2:BX28;"N")
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Re: Referencing a value in a cell
A cell containing the formula (you may also do it with COUNTIF) will show the result as "13" e.g. as long as it is set to 'Numbers' format Genereal or format code #0 e.g. Setting the 'Numbers' format to #0" Y" will then display "13 Y", an you can even get the (imo malformed) "Y= 13" with the help of the code "Y= "#0. This kind of formatting does not interfere with any calculations.
Code: Select all
=SUMPRODUCT(BX2:BX28="Y")
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: Referencing a value in a cell
Thanks. Not perfect, but that helps.
OpenOffice 4.1 on Windows 8.1
Re: Referencing a value in a cell
The main problem that I can see with Lupp's suggestion, is the fact that you can't have both the Y and N calculations in the same cell, contrary to how your current formula is setup
With careful cell width adjustment, you might be able to get two cells, one with the Y calculation and one with the N calculation to look like they are in one cell.
With careful cell width adjustment, you might be able to get two cells, one with the Y calculation and one with the N calculation to look like they are in one cell.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Re: Referencing a value in a cell
An addendum probably applicable in very rare cases of the kind:
There actually is a set of standard functions creating and evaluating texts of a specific format which represent a pair of numeric values each. I am talking of the way complex numbers are implemented in spreadsheets. However, you cannot re-format these numbers by 'Numbers' format codes for the very reason that they already are texts, technically. Reformatting them with text functions would spoil the usability with functions made for complex numbers in the mentioned sense, on the other hand.
Also note: There is no function for complex numbers allowing for cuboids on parameter places.
There actually is a set of standard functions creating and evaluating texts of a specific format which represent a pair of numeric values each. I am talking of the way complex numbers are implemented in spreadsheets. However, you cannot re-format these numbers by 'Numbers' format codes for the very reason that they already are texts, technically. Reformatting them with text functions would spoil the usability with functions made for complex numbers in the mentioned sense, on the other hand.
Also note: There is no function for complex numbers allowing for cuboids on parameter places.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: Referencing a value in a cell
How can I split a cell without creating an extra column?RusselB wrote:The main problem that I can see with Lupp's suggestion, is the fact that you can't have both the Y and N calculations in the same cell, contrary to how your current formula is setup
With careful cell width adjustment, you might be able to get two cells, one with the Y calculation and one with the N calculation to look like they are in one cell.
OpenOffice 4.1 on Windows 8.1
Re: Referencing a value in a cell
I think you have to create an extra column, but could remove the intervening border so that the double cell looks like one cell.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Referencing a value in a cell
Tried this:RoryOF wrote:I think you have to create an extra column, but could remove the intervening border so that the double cell looks like one cell.
To split a cell into multiple cells:
Position the cursor inside the cell.
Right-click and select Cell > Split on the pop-up menu, or select Table > Split Cells from the menu bar.
Didn't work. I have too many columns so I settled for another row.
OpenOffice 4.1 on Windows 8.1
Re: Referencing a value in a cell
leeelson....
Have a look at the way this file is laid out for rows AO30 and AO33. AO30:AR30 are individual cells as well as
AO34:AR34 . When adding new data into sheets to the right of the first sheet, the formulas in AP33 & AR33 will automatically adjust the sheet number as they are set up with RELATIVE addressing. The 1st sheet has an ABSOLUTE address so it will not increase. Column & Row addresses are also ABSOLUTE.
Just make sure to adjust the formulas to reflect any changes you make to the layout of the Columns / Rows where the
" Y " and " N " are in AP30 & AR30.
Have a look at the way this file is laid out for rows AO30 and AO33. AO30:AR30 are individual cells as well as
AO34:AR34 . When adding new data into sheets to the right of the first sheet, the formulas in AP33 & AR33 will automatically adjust the sheet number as they are set up with RELATIVE addressing. The 1st sheet has an ABSOLUTE address so it will not increase. Column & Row addresses are also ABSOLUTE.
Just make sure to adjust the formulas to reflect any changes you make to the layout of the Columns / Rows where the
" Y " and " N " are in AP30 & AR30.
3.4.1 & 4.1.5 on MS Windows 7 Pro x64
Re: Referencing a value in a cell
Thanks for your input.thinman3 wrote:leeelson....
Have a look at the way this file is laid out for rows AO30 and AO33. AO30:AR30 are individual cells as well as
AO34:AR34 . When adding new data into sheets to the right of the first sheet, the formulas in AP33 & AR33 will automatically adjust the sheet number as they are set up with RELATIVE addressing. The 1st sheet has an ABSOLUTE address so it will not increase. Column & Row addresses are also ABSOLUTE.
Just make sure to adjust the formulas to reflect any changes you make to the layout of the Columns / Rows where the
" Y " and " N " are in AP30 & AR30.
2 problems with this approach: 1)different number of rows on each page so 2)cumulative sum becomes too long after e.g. 100 sheets (SUM(sheet1.a30;sheet2.a31;sheet3.a34........;sheet100.a30))
What does work is Lupp's suggestion of putting text into the cell format so the cell itself is a number. This allows simple cumulative formulae which doesn't grow longer with each sheet.
OpenOffice 4.1 on Windows 8.1
Re: Referencing a value in a cell
AP33 formula::: SUM($Sheet1.$AP$30:Sheet2.$AP$30)
AR33 formula::: SUM($Sheet1.$AR$30:Sheet2.$AR$30)
For each of these formulas, all you need to do is change the reference of Sheet2.$AP$30 and Sheet2.$AR$30 to reflect the
sheet number of the last sheet in the file. If Sheet54 is the last numbered sheet tab at the bottom of the screen, simply change Sheet2.$AP$30 and Sheet2.$AR$30 to Sheet54.$AP$30 and Sheet54.$AR$30. If there is no data in the sheets
between Sheet2 and Sheet54, it won't matter. It will only SUM up the numbers on the sheets that have data entered.
Look at the formula on Sheet4 in cell(s) AP33 and AR33; it references Sheet1 to Sheet 4. To see what I mean, go to Sheet3
and delete all the data in AS2:AS28 and / or BX2:BX28. The results for "Y" & "N" should only be diminished by the total
that is currently displayed on Sheet3 in AP30 and AR30.
As for the sheets having different number of rows, simply make all the sheets the same length as the longest sheet and
adjust the formulas accordingly. For instance, for the formula in either AP30 or AR30 , COUNTIF($AS$2:$BX$28;"N"); if one sheet goes to $BX$55 and another sheet goes to $BX$1000, change $BX$28 to $BX$1000.
AR33 formula::: SUM($Sheet1.$AR$30:Sheet2.$AR$30)
For each of these formulas, all you need to do is change the reference of Sheet2.$AP$30 and Sheet2.$AR$30 to reflect the
sheet number of the last sheet in the file. If Sheet54 is the last numbered sheet tab at the bottom of the screen, simply change Sheet2.$AP$30 and Sheet2.$AR$30 to Sheet54.$AP$30 and Sheet54.$AR$30. If there is no data in the sheets
between Sheet2 and Sheet54, it won't matter. It will only SUM up the numbers on the sheets that have data entered.
Look at the formula on Sheet4 in cell(s) AP33 and AR33; it references Sheet1 to Sheet 4. To see what I mean, go to Sheet3
and delete all the data in AS2:AS28 and / or BX2:BX28. The results for "Y" & "N" should only be diminished by the total
that is currently displayed on Sheet3 in AP30 and AR30.
As for the sheets having different number of rows, simply make all the sheets the same length as the longest sheet and
adjust the formulas accordingly. For instance, for the formula in either AP30 or AR30 , COUNTIF($AS$2:$BX$28;"N"); if one sheet goes to $BX$55 and another sheet goes to $BX$1000, change $BX$28 to $BX$1000.
3.4.1 & 4.1.5 on MS Windows 7 Pro x64
Re: Referencing a value in a cell
The problem is that the cells to be summed are not always in the same row. Thus Sheet54.$AP$30 is the wrong cell (has wrong non-zero data). The proper cell is Sheet54.$AP$31 and for sheet 1001, it's Sheet1001.$AP$28. This makes my sum 1001 terms long and not feasible.thinman3 wrote:AP33 formula::: SUM($Sheet1.$AP$30:Sheet2.$AP$30)
AR33 formula::: SUM($Sheet1.$AR$30:Sheet2.$AR$30)
For each of these formulas, all you need to do is change the reference of Sheet2.$AP$30 and Sheet2.$AR$30 to reflect the
sheet number of the last sheet in the file. If Sheet54 is the last numbered sheet tab at the bottom of the screen, simply change Sheet2.$AP$30 and Sheet2.$AR$30 to Sheet54.$AP$30 and Sheet54.$AR$30. If there is no data in the sheets
between Sheet2 and Sheet54, it won't matter. It will only SUM up the numbers on the sheets that have data entered.
Look at the formula on Sheet4 in cell(s) AP33 and AR33; it references Sheet1 to Sheet 4. To see what I mean, go to Sheet3
and delete all the data in AS2:AS28 and / or BX2:BX28. The results for "Y" & "N" should only be diminished by the total
that is currently displayed on Sheet3 in AP30 and AR30.
As for the sheets having different number of rows, simply make all the sheets the same length as the longest sheet and
adjust the formulas accordingly. For instance, for the formula in either AP30 or AR30 , COUNTIF($AS$2:$BX$28;"N"); if one sheet goes to $BX$55 and another sheet goes to $BX$1000, change $BX$28 to $BX$1000.
OpenOffice 4.1 on Windows 8.1
Re: Referencing a value in a cell
Could you enter a referencing formula into a cell on each sheet (eg: on Sheet54 in cell AAA1 put =AP31) so that you have the same cell address (AAA1) on each sheet referring to the correct address?
Then you could use the SUM function as exampled by thinman
The only other alternative, is to manually insert rows/columns to make the information you want to SUM in the same row and column.
BTW: Do you really have over 1000 sheets?
Then you could use the SUM function as exampled by thinman
The only other alternative, is to manually insert rows/columns to make the information you want to SUM in the same row and column.
BTW: Do you really have over 1000 sheets?
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Re: Referencing a value in a cell
Not yetRusselB wrote: BTW: Do you really have over 1000 sheets?
OpenOffice 4.1 on Windows 8.1
Re: Referencing a value in a cell
I've read and re-read your posts and have found no information as to what is being used to determine the " Y " or " N " entries; so , please provide a sample file ( with @ least 3 sheets ) with the " data " you are using , including the Y / NThe problem is that the cells to be summed are not always in the same row. Thus Sheet54.$AP$30 is the wrong cell (has wrong non-zero data). The proper cell is Sheet54.$AP$31 and for sheet 1001, it's Sheet1001.$AP$28. This makes my sum 1001 terms long and not feasible.
results. Additionally, provide a narrative as to how the Y / N totals should be summed across multiple sheets. If the data is on different rows on different sheets, it would seem that unique data would have to be entered on Sheet1 and / or Sheet2 and / or Sheet3 to be able to arrive at a SUM for the Y / N entries.
There are many capable forum members here to help with your post; help us, help you.
3.4.1 & 4.1.5 on MS Windows 7 Pro x64
Re: Referencing a value in a cell
I've created a greatly truncated and abbreviated version. I need to know the number of "Y" and "N" values on each sheet and the cumulative number of "Y" and "N" values on that sheet + previous sheets. Several rules: no columns can be added. I need to minimize the number of rows added: they can only be added at the bottom. Also, changing the number of data rows (Y or N values) is not allowed. Moving data (Y or N values) from one sheet to another is not allowed. Although I don't show it, the Y or N values may be in different columns on different sheets. Hope this helps.
- Attachments
-
- survey.ods
- (14.29 KiB) Downloaded 97 times
OpenOffice 4.1 on Windows 8.1
Re: Referencing a value in a cell
Your latest post, with the restrictions you have specified, makes this impossible to my knowledge of spreadsheets
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Re: Referencing a value in a cell
I'm getting that impression. Lupp's workaround using cell formatting works pretty well. That's what I'm using now.RusselB wrote:Your latest post, with the restrictions you have specified, makes this impossible to my knowledge of spreadsheets
OpenOffice 4.1 on Windows 8.1