Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I get the Pop-up Menu to refer to cells' contents?

I have multiple cells that contain different numbers. I need a Pop-up Menu cell to select one of those numerical cells, which will be referenced and treated numerically by a later cell. The problem I'm encountering is that the Pop-up Menu items are being treated as strings rather than referencing the cells' numbers, although the cell mentioned will become highlighted upon selection. For example, if the item is =C33, it will simply say "=C33" in the cell: If I try to manipulate that Pop-up Menu cell numerically in another cell, it comes up with the error that a number is expected where a string was encountered.


What is wrong? Must I use some function like "str2num(C40)" to convert from a string to a number? Is there something that needs to be typed in the item itself while editing the Pop-up Menu cell?


Please help! Thank you for your time.

MacBook Pro, Mac OS X (10.6.8), 2.4GHzIntelCore2Duo;4GB 1067MHzDDR3

Posted on Mar 10, 2013 10:57 AM

Reply
Question marked as Best reply

Posted on Mar 10, 2013 11:32 AM

ER,


Pop-Up menu formats can contain any data format, from Strings to Dates/Times to regular numeric values. One thing they can't contain is a CellAddressVector. It's easy to use C33 from a Pop-Up list as a way to point to an address by using the INDIRECT function. INDIRECT(C33) is a reference to the cell address C33.


For example to add 10 to the numeric value stored in cell C33, you could write:


=INDIRECT(C33) + 10 where C33 is a string.


Regards,


Jerry

14 replies
Question marked as Best reply

Mar 10, 2013 11:32 AM in response to ethereality

ER,


Pop-Up menu formats can contain any data format, from Strings to Dates/Times to regular numeric values. One thing they can't contain is a CellAddressVector. It's easy to use C33 from a Pop-Up list as a way to point to an address by using the INDIRECT function. INDIRECT(C33) is a reference to the cell address C33.


For example to add 10 to the numeric value stored in cell C33, you could write:


=INDIRECT(C33) + 10 where C33 is a string.


Regards,


Jerry

Mar 13, 2013 5:56 PM in response to Badunit

Thank you very much -- but is there a way to show the contents of, say, C33, instead of that cell* displaying the text "C33"? I can now use it to manipulate the data numerically, thank you very much, via the INDIRECT function, but I would also like that cell to display the number, instead of displaying "C33". Is that possible? If not, why not?


* I mean the cell formatted as a Popup Menu.

Mar 13, 2013 10:50 PM in response to ethereality

" is there a way to show the contents of, say, C33, instead of that cell* (the cell containing the pop-up menu) displaying the text "C33"?"


No.


"If not, why not?"


For the same reason that you can't wouldn't paint the barn with a potato peeler—it's not a feature/function supported by the software (or in the case of the potator peeler, by the hardware).


Regarding the obvious follow-up question "Why isn't it a supported feature?", That's not a question falling within the knowledge field of this user-to-user forum. If you'd like to see this feature added to Numbers, use the Provide Numbers Feedback menu item in the Numbers menu to make a feature enhancement request.


Regards,

Barry

Mar 14, 2013 4:04 AM in response to ethereality

ER,


I reviewed the answer I gave you above and I think it could have been clearer and more concise. I hope it didn't confuse the issue for you. It's difficult to imagine that you would need some new addressing mode that nobody else thought of or implemented in the last 50-plus years of computer science.


The addressing modes available to you are:


Direct; Relative and Absolute

Indirect

Indexed

Offset


Those modes are all you will ever need, believe me. I suggest that you experiment with Indirect addressing until you gain an understanding of how it works.



Jerry

Mar 14, 2013 5:41 AM in response to ethereality

ethereality wrote:


Thank you very much -- but is there a way to show the contents of, say, C33, instead of that cell* displaying the text "C33"? I can now use it to manipulate the data numerically, thank you very much, via the INDIRECT function, but I would also like that cell to display the number, instead of displaying "C33". Is that possible? If not, why not?


* I mean the cell formatted as a Popup Menu.


I understand what you want to do, it just can't be done. There are two types of cells: ones that you (the user) enter data into and ones that use formulas to determine their value. Pop up menus are data-entry cells.


If you don't like the look of a "C33" or "C34" being displayed on your table, you can set the text color to "none" for the pop-up menu. Of course, now there won't be any indication that that cell is anything at all. No one will know that they need to click there. A solution to that is to make a background image for the cell that lets the user know to click on that cell. A quick way to do that is:


  1. Create a text box in Numbers and type smething in it like "Click Here"
  2. Copy the text box (the entire box, not just the text)
  3. Open the Preview app and do File/New From Clipboard. This will create a new image in Preview from the text box.
  4. Select the new image in the Preview sidebar (show the sidebar if it is not there) and copy it (Cmd C)
  5. Go back to Numbers and Paste the image into the cells that need it. It will become an image background.

Mar 14, 2013 6:27 AM in response to ethereality

Ether,


There is a Numbers-specific solution to the request that this thread has morphed into. Numbers can stack tables such that one table will show through another table and in effect you "see" two tables at once. In this way you can make a Pop-Up selection and see the result of that selection in the same screen space.


Example:

User uploaded file

In this screen shot you see two tables. A table called Main is on top and a table called Secondary is set behind Main. Main's table fill is set to none so Secondary will show through. The Text Color for Main's A2:A4 is set to zero opacity so you won't see the selections except when you are choosing.


The Pop-Up menu items are the addresses of the data in column B, expressed in text format. If Main::B2 is selected, the content of Main::B2 will show up in the green cell behind the Pop-up.


The green cell, Secondary::A1 has this expression:


=INDIRECT(Main :: A2)


Fill Down.


Is this what you had in mind?


Jerry

Mar 14, 2013 5:55 PM in response to ethereality

Badunit, Jerry, Barry, thank you.


I think it would help if I clarified what I am trying to do. A screenshot I think will make the matter obvious. I am trying to make a table that flows depending on the situation the user is in. One of the later formula-using data cells (C50) essentially depends on a piecewise-defined function (defined via formulae in C34-C36): basically, "If x ≥ y, then k = x*a. If x < y, then k = x*b," of course with these letters representing different numbers.


I wanted one cell to be a drop-down menu for x = ____ (C37, to select from C34-C36), then the later formula-cell (C50) to use that value (which I can do with the INDIRECT function), but I wanted that cell (C37) to read as the value of x, not as "C33", etc.


Below is the screenshot. k_Q depends on %dd(10), and %dd(10) is the piecewise function. The purple cells are Pop-up Menus, whose items are the values that will be encountered (e.g. from tabulated data, so the user has only to click, rather than type numbers manually), or else questions to say "yes" or "no" to (reminders, basically). The green cells contain formulas to automatically calculate a value based on measurements: The blank white cells are where the user will enter the measured value. Column C represents data for 6 MV, while column D represents data for 10 MV.


So you see why I want C37 and D37 to complete the statement, "%dd(10) = ____": It logically makes sense in the spreadsheet, and later cells depend on that value. I want it to be a Pop-up Menu, rather than direct data entry, because the procedure is repetitive, and there is less chance for error if one selects an entry rather than types raw numbers -- it's also easier for the user to click once than to type five keystrokes.


User uploaded file


It makes the most sense to me if I could simply say "=C28" as the popup menu entry, so that it would refer to and display whatever is in cell C28. But as I said in the OP, typing '=C28' creates the string (text) '=C28', rather than what I want it to do.


Sorry for the exhaustive reply, but I felt it was appropriate to be explicit, given the detailed nature of the responses I've received. I entered the cell references after including the screenshot -- sorry if it was longwinded.


(By the way, Jerry, your responses are informative but difficult for me to understand. I am apparently not as experienced with Numbers as you are.)

Mar 14, 2013 6:20 PM in response to Jerrold Green1

Aw, I was hoping you would keep helping me -- you sound like you're finished replying ...


(I tried to edit my previous response to include a corrected image (the last two cells should have been filled green, in keeping with my pattern, since they were cells with formulas). This computer's not successfully inserting any more images, though -- I suppose there is a problem with my Verizon hotspot. Cells C50 and D50 should be green, as the other formula cells are.)

Mar 15, 2013 12:43 AM in response to ethereality

I took a look at your previous post earlier, but didn't have time to search through and figure out what was going on.


What determines which of the the values in cells C34, C35, and C36 is to be chosen? Could that choice be expressed in a formula?


Incidently, there's some redundancy in the formula at the end of your first paragraph: "If x ≥ y, then k = x*a. If x < y, then k = x*b"


Since the two conditions are mutually exclusive, only one needs to be tested. Here's the IF version of your statement. X is in B2, Y in C2, A in D2, and B in E2. The formula (and the value of K) is in F2.

F2: =IF(B2<C2,B2*E2,B2*D2)


Here's the results with the conditions indicated in column A:

User uploaded file


Regards,

Barry

Mar 16, 2013 2:01 PM in response to ethereality

How about something like in the screenshots below?


I split cell C5. C5 is a popup cell with purple fill, purple text color, and the items C2, C3, C4.


D5 =INDIRECT(C5)


User uploaded file


User uploaded file


Or something like this, using checkboxes to select which value to use:


User uploaded file


The formula in C5 could be a simple LOOKUP (which will default to the last value in the list, 9.5, if no boxes are checked) or something a more complex like


=IFERROR(OFFSET(C2,MATCH(TRUE,D2:D4,0)-1,0),"")


Or, if the checkboxes are put to the left of the numbers, you can use VLOOKUP to do what I did with OFFSET and MATCH in the formula above.

How do I get the Pop-up Menu to refer to cells' contents?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.