If & Else

Xirom431

Board Regular
Joined
Dec 2, 2010
Messages
102
Hi,

I have these 3 columns. If Column 2 less than 5 then it will be 100% in Column 3 and anything below 5 will be %. I have tried if and else but it did not work. Not very good at these formulas. Thanks. Excel 2010.

<TABLE style="WIDTH: 138pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=183><COLGROUP><COL style="WIDTH: 46pt; mso-width-source: userset; mso-width-alt: 2230" span=3 width=61><TBODY><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 1pt solid; BACKGROUND-COLOR: transparent; WIDTH: 46pt; HEIGHT: 17.1pt; BORDER-TOP: red 0.5pt solid; BORDER-RIGHT: red 0.5pt solid" class=xl70 height=22 width=61>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; WIDTH: 46pt; BORDER-TOP: red 0.5pt solid; BORDER-RIGHT: red 0.5pt solid" class=xl71 width=61>4</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; WIDTH: 46pt; BORDER-TOP: red 0.5pt solid; BORDER-RIGHT: red 0.5pt solid" class=xl72 width=61>1.3</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 1pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl70 height=22>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl71>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl72>1.0</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 1pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl70 height=22>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl71>6</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl72>0.8</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 1pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl70 height=22>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl71>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl72>1.0</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 1pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl70 height=22>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl71>7</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl72>0.7</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 1pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl70 height=22>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl71>4</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl72>1.3</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 1pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl70 height=22>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl71>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl72>1.0</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 1pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl70 height=22>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl71>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl72>1.0</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 1pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl70 height=22>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl71>2</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl72>2.5</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 1pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl70 height=22>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl71>3</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl72>1.7</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 1pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl70 height=22>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl71>4</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl72>1.3</TD></TR><TR style="HEIGHT: 17.1pt; mso-height-source: userset" height=22><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: red 1pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 17.1pt; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl70 height=22>5</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl71>8</TD><TD style="BORDER-BOTTOM: red 0.5pt solid; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: red; BORDER-RIGHT: red 0.5pt solid" class=xl72>0.6</TD></TR></TBODY></TABLE>
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Your posted sample doesn't make sense - the first row should equal 1, not 1.3. Anyway, try this in C1 and copy down:
=MIN(A1/B1,1)
 
Upvote 0

Forum statistics

Threads
1,224,538
Messages
6,179,412
Members
452,912
Latest member
alicemil

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