How to display a design in a cell (formula based) to be chosen from either of 3 designed cells

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,213
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
1. I have 2 columns with numerical values; say A1 = 130.25 & B1 = 118.68.
2. I have designed 3 arrows (representing UP, DOWN & EQUAL) & have inserted in 3 separate cells, say, R1, S1 & T1.
3. C1=A1-B1 (formula).
4. I want corresponding arrows to be grasped (from either R1, S1 or T1) based on the result in C1 & shown in cell C1. It has to be à If C1=+ve then get R1, -ve get S1, =0 get T1. HOW TO DO THIS?
5. A1 & B1 are DDE feeds & keeps on changing frequently, thus cell C1 should also keep its pace. I am using excel2007.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p> </o:p>
Thanks in advance. Please do help. Please.
<o:p> </o:p>
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
So what is inserted in R1 S1 and T1 exactly? Are they cell contents, or objects located over those cells? Or something else?
 
Upvote 0
If they are cell contents, try (edited)

=CHOOSE(SIGN(A1-B1)+2,S1,T1,R1)
 
Last edited:
Upvote 0
If they are cell contents, try (edited)

=CHOOSE(SIGN(A1-B1)+2,S1,T1,R1)

Peter,
It works. But I’ll try to express myself more clearly. It works & C1 is able to get the values from R1, S1 or T1 provided they (R1, S1 or T1) are ALPHABETS or NUMERICAL or ALPHANUMERICAL.
In R1, S1 & T1, I had used Insert|Shapes|chosen from ‘Block Arrows’ 3 arrows (UP, DOWN & EQUAL) & then had filled some colors, Line Color, Line Style using à ‘Format Shape’.
Is it possible to get any of the 3 arrows in the Display Cell C1 depending upon its formula’s result?
It has to be if C1>0, get R1, if C1<0, get S1 or if C1=0, get T1.
Technically, I do not know exactly what word I should use: Content or Laid, so I had tried to express myself as above.
I need to show in C1 either of 3 arrows. They may be ‘Laid’ (if I am using this word correctly here) In R1, S1 & T1 but I do not know how to lay them. You may please help me here if this solves the problem.
Sandeep
 
Upvote 0
So what is inserted in R1 S1 and T1 exactly? Are they cell contents, or objects located over those cells? Or something else?

Glenn,
I had replied below. Please see & help.
Sandeep
 
Upvote 0
In R1, S1 & T1, I had used Insert|Shapes|chosen from ‘Block Arrows’ 3 arrows (UP, DOWN & EQUAL) & then had filled some colors, Line Color, Line Style using à ‘Format Shape’.
Is it possible to get any of the 3 arrows in the Display Cell C1 depending upon its formula’s result?
It has to be if C1>0, get R1, if C1<0, get S1 or if C1=0, get T1.
Technically, I do not know exactly what word I should use: Content or Laid, so I had tried to express myself as above.
I need to show in C1 either of 3 arrows. They may be ‘Laid’ (if I am using this word correctly here) In R1, S1 & T1 but I do not know how to lay them. You may please help me here if this solves the problem.
Sandeep
I think you are going to struggle to do it directly this way. A couple of alternatives to consider ...

A. Use Wingdings font like you did in your post. Format C1 as Wingdings font and use this formula in C1. You then don't even need R1:T1.
=CHOOSE(SIGN(A1-B1)+2,"é","è","ê")

B. Have your shapes as you described in R1:T1 and use this code. To implement ..

1. Right click the sheet name tab and choose "View Code".

2. Copy and Paste the code below into the main right hand pane that opens at step 1.

3. Close the Visual Basic window.

4. Make a change to A1 or B1.

<font face=Courier New><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Worksheet_Change(<SPAN style="color:#00007F">ByVal</SPAN> Target <SPAN style="color:#00007F">As</SPAN> Range)<br>    <SPAN style="color:#00007F">Dim</SPAN> sSource <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN><br><br>    <SPAN style="color:#00007F">If</SPAN> <SPAN style="color:#00007F">Not</SPAN> Intersect(Target, Range("A1:B1")) <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN> <SPAN style="color:#00007F">Then</SPAN><br>        <SPAN style="color:#00007F">If</SPAN> IsNumeric(Range("A1").Value) And <SPAN style="color:#00007F">Is</SPAN>Numeric(Range("B1").Value) <SPAN style="color:#00007F">Then</SPAN><br>            ClearShapeInC1<br>            <SPAN style="color:#00007F">Select</SPAN> <SPAN style="color:#00007F">Case</SPAN> Range("A1").Value - Range("B1").Value<br>                <SPAN style="color:#00007F">Case</SPAN> <SPAN style="color:#00007F">Is</SPAN> > 0<br>                    sSource = "R1"<br>                <SPAN style="color:#00007F">Case</SPAN> <SPAN style="color:#00007F">Is</SPAN> < 0<br>                    sSource = "S1"<br>                <SPAN style="color:#00007F">Case</SPAN> Is = 0<br>                    sSource = "T1"<br>            <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Select</SPAN><br>            Application.EnableEvents = <SPAN style="color:#00007F">False</SPAN><br>            Range(sSource).Copy Destination:=Range("c1")<br>            Application.EnableEvents = <SPAN style="color:#00007F">True</SPAN><br>        <SPAN style="color:#00007F">Else</SPAN><br>            ClearShapeInC1<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br><SPAN style="color:#00007F">Sub</SPAN> ClearShapeInC1()<br>    <SPAN style="color:#00007F">Dim</SPAN> sh <SPAN style="color:#00007F">As</SPAN> Shape<br>    <br>    <SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> sh <SPAN style="color:#00007F">In</SPAN> ActiveSheet.Shapes<br>        <SPAN style="color:#00007F">If</SPAN> sh.TopLeftCell.Address = "$C$1" <SPAN style="color:#00007F">Then</SPAN><br>            sh.Delete<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <SPAN style="color:#00007F">Next</SPAN> sh<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>
 
Upvote 0
Glenn,
I had replied below. Please see & help.
Sandeep

Hi Sandeep,

it's very easy to do this directly, using defined names and a picture object.

Firstly assign defined names to the 3 cells R1, S1, and T1, such as UPARROW, DOWNARROW and EQUALS.

Now create a defined name of PICTURECHOICE with a definition of:
Code:
=IF(Sheet1!$C$1>0,INDIRECT("UPARROW"),IF(Sheet1!$C$1<0,INDIRECT("DOWNARROW"),INDIRECT("EQUALS")))
( assuming this is all in Sheet1 ... adjust to your case )

Now generate a picture object ... the easiest way is to use the camera tool, by taking a picture of any cell in the sheet, and drawing a picture object over cell D1. The picture will have an assignment ( see the formula bar ) pointing to the cell ref of the picture taken ... alter this to be =PICTURECHOICE

That's it.
 
Upvote 0
Peter,
Yes both A & B had worked.
Thanks Peter for your kind gesture. But please would you let me know technically what is difference between “Content” or “Laid” in a cell. This may help me.
Sandeep
 
Upvote 0
Where did you get the term "Laid", as far as I know I didn't use it?
 
Upvote 0
Hi Peter, by the way, a variation on your method A is to specify the WingDing chars in a custom number format, and you can colour at the same time that way :
Have =A1-B1 in a cell, format number format as Custom with a format of:
Code:
[Green]"ê";[Red]"é";"è"
and format the cell font as WingDings.

Just thought you might like to know that method too.
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,033
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top