Inserting symbols using =IF?

reducedjuice

Board Regular
Joined
Oct 29, 2008
Messages
99
Quick question in Excel07:

I am writing an if statement to compare the values of two cells (both numeric values); call them X and Y to keep it simple.

If Y>X, I want there to be a nice green arrow displayed next to Y to indicate that the value is greater than X.


Can this be done using an IF statement? =if(Y>X,InsertGreenArrow,InsertRedArrow)

Kind of a left-field question :cool:

Thanks!
-reducedjuice
 
Last edited:

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Sure there is :)

you need conditional formatting for the green and red.
you need to set the font as wingdings (or similar)
get the letter reference for the up and downarrow , I thought it was J for up and K for down, but that´s easily checked in word or wherever.

If you put the formula

Code:
=IF(Y>X,J,K)

And do conditional formatting on that cell, e.g. paint font Red if K and paint font green if J
 
Upvote 0
I can not think of a function to do this, but I'm pretty sure it could be done with code. Here's perhaps an easier solution.

Place an Autoshape arrow in the desired cell. Make the arrow's fill the same color as the cell background, and then turn off the arrow's outline. At this point, you will not be able to see the arrow.

Now select Format > Conditional Formatting, and conditionally format the color of the cell to be green when Y>X, and red when X>Y. When a condition is met, the cell color changes to either green or red, and you can see the arrow.
 
Upvote 0
reducedjuice

Since you are using Excel 2007, you could also use some of the new built-in features to achieve this. You didn't say what you wanted if X=Y, but see if this helps.

1. Try a formula like this in C2 (copied down)

Excel Workbook
ABC
1XY
284-1
3220
4131
5-531
62004-1
Sheet1


2. Select C2:C6

3. Home tab|Conditional Formatting|Icon sets|choose the first one with green up arrow, orange sideways arrow and red down arrow.

4. (Optional) Home tab|Conditional Formatting|Manage rules...|select the icon set rule|Edit Rule...|Show icon only (bottom right)|OK|Apply|OK
 
Upvote 0

Forum statistics

Threads
1,214,413
Messages
6,119,372
Members
448,888
Latest member
Arle8907

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