Compare values in cells and give result

julios

New Member
Joined
Dec 23, 2010
Messages
18
I am trying to make this spreadsheet (link to online google doc) and i ran into a problem that i can't seem to be able to fix. My knowledge is rather limited so i don't know if this can be done with simple functions or not. Here it goes:

On column "J" i want to get a result of the comparison of columns "E" and "I" (you can see an "if" function).

But what i really need is for the formula of column "J" to first check if both columns "E" and "I" have values in the same row or if they are blank (or only one has a value). If both columns have values in the same row, compare these values and give back a text result if the value of column "E" is higher, if the value of column "I" is higher and a different text if both values are the same.

Finally at the bottom of column "J" i need the percentage of the 3 outcomes in the entire column.

Any help will be very apreciated :)
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
For the first part:
Code:
=IF(NOT(OR(ISBLANK(E4),ISBLANK(I4))),IF(E4<=I4,IF(E4=I4,"equaltext","E4lessthanI4text"),"E4greaterthanI4text"),"")

Replace the three strings ending in "text" with whatever you want.

What do you mean by "the percentage of the 3 outcomes in the entire column."?
 
Upvote 0
For the first part:
Code:
=IF(NOT(OR(ISBLANK(E4),ISBLANK(I4))),IF(E4<=I4,IF(E4=I4,"equaltext","E4lessthanI4text"),"E4greaterthanI4text"),"")
Replace the three strings ending in "text" with whatever you want.

What do you mean by "the percentage of the 3 outcomes in the entire column."?


Thank you very much! First part works like a charm. For the second part i mean for example text 1 appears say 6 times, text 2 appears 3 times and equaltext apears 1 time, while 13 cells are blank. That gives a 60% appearnce of text 1, 30% for text 2 and 10% for equaltext. I need the blank fields to be excluded. Results may also come as a chart
 
Upvote 0
Try this:

Code:
=COUNTIF($J$1:$J$468,"text")/(COUNTA($J$1:$J$468)-COUNTBLANK($J$1:$J$468))

You'll have to use 3 different cells - one for each condition. Replace "text" with whatever the text you've chosen for that particular condition. (You can convert to percentage using rightclick -> Format Cells.)

I assumed you wanted it to cover J1 to J468, but you can change this if this is not the case. Just make sure that the formula for the first part (in my previous reply) is copied into all cells that are counted by this formula (i.e. J1-J468, or whatever other range you choose) - otherwise it won't work.
 
Upvote 0

Forum statistics

Threads
1,224,621
Messages
6,179,941
Members
452,949
Latest member
beartooth91

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