IF and average

Ingolf

Banned
Joined
Mar 20, 2011
Messages
809
Hey

I need some help to solve a small problem.

Excell%202010.jpg


Any help will be apreciated.

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th><th>H</th><th>I</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: center;;">NAME</td><td style="text-align: center;;">Math-1</td><td style="text-align: center;;">Math-2</td><td style="text-align: center;;">Math-3</td><td style="text-align: center;;">Math-4</td><td style="text-align: center;;">Math-5</td><td style="text-align: center;;">Average</td><td style="text-align: right;;"></td><td style="text-align: center;;">RESULT WANTED</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style=";">QAKR</td><td style="text-align: center;;">6</td><td style="text-align: center;;">6</td><td style="text-align: center;;">5</td><td style="text-align: center;;">6</td><td style="text-align: center;;">9</td><td style="text-align: center;;">6,40</td><td style="text-align: right;;"></td><td style="text-align: center;;">IF is 5 numbers and IF all number >5 ---> average (B2:F2)</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">EYNJ</td><td style="text-align: center;;">6</td><td style="text-align: center;;">8</td><td style="text-align: center;;">4</td><td style="text-align: center;;">-</td><td style="text-align: center;;">5</td><td style="text-align: center;;">5,75</td><td style="text-align: right;;"></td><td style="text-align: center;;">1 exam lost and 1 absence</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">QJFQ</td><td style="text-align: center;;">5</td><td style="text-align: center;;">5</td><td style="text-align: center;;">9</td><td style="text-align: center;;">9</td><td style="text-align: center;;">8</td><td style="text-align: center;;">7,20</td><td style="text-align: right;;"></td><td style="text-align: center;;">IF is 5 numbers and IF all number >5 ---> average (B4:F4)</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style=";">WSHK</td><td style="text-align: center;;">6</td><td style="text-align: center;;">7</td><td style="text-align: center;;">6</td><td style="text-align: center;;">7</td><td style="text-align: center;;">4</td><td style="text-align: center;;">6,00</td><td style="text-align: right;;"></td><td style="text-align: center;;">1 exam lost</td></tr><tr ><td style="color: #161120;text-align: center;">6</td><td style=";">VCTR</td><td style="text-align: center;;">6</td><td style="text-align: center;;">2</td><td style="text-align: center;;">6</td><td style="text-align: center;;">10</td><td style="text-align: center;;">4</td><td style="text-align: center;;">5,60</td><td style="text-align: right;;"></td><td style="text-align: center;;">2 exam lost</td></tr><tr ><td style="color: #161120;text-align: center;">7</td><td style=";">ZDPS</td><td style="text-align: center;;">9</td><td style="text-align: center;;">8</td><td style="text-align: center;;">10</td><td style="text-align: center;;">6</td><td style="text-align: center;;">2</td><td style="text-align: center;;">7,00</td><td style="text-align: right;;"></td><td style="text-align: center;;">1 exam lost</td></tr><tr ><td style="color: #161120;text-align: center;">8</td><td style=";">KDFA</td><td style="text-align: center;;">-</td><td style="text-align: center;;">-</td><td style="text-align: center;;">-</td><td style="text-align: center;;">-</td><td style="text-align: center;;">-</td><td style="text-align: center;;"></td><td style="text-align: right;;"></td><td style="text-align: center;;">no exams</td></tr><tr ><td style="color: #161120;text-align: center;">9</td><td style=";">DZNF</td><td style="text-align: center;;">10</td><td style="text-align: center;;">3</td><td style="text-align: center;;">5</td><td style="text-align: center;;">-</td><td style="text-align: center;;">5</td><td style="text-align: center;;">5,75</td><td style="text-align: right;;"></td><td style="text-align: center;;">1 lost and 1 absence</td></tr><tr ><td style="color: #161120;text-align: center;">10</td><td style=";">UFFV</td><td style="text-align: center;;">9</td><td style="text-align: center;;">2</td><td style="text-align: center;;">10</td><td style="text-align: center;;">2</td><td style="text-align: center;;">10</td><td style="text-align: center;;">6,60</td><td style="text-align: right;;"></td><td style="text-align: center;;">2 lost</td></tr><tr ><td style="color: #161120;text-align: center;">11</td><td style=";">MFCK</td><td style="text-align: center;;">8</td><td style="text-align: center;;">6</td><td style="text-align: center;;">8</td><td style="text-align: center;;">10</td><td style="text-align: center;;">10</td><td style="text-align: center;;">8,40</td><td style="text-align: right;;"></td><td style="text-align: center;;">average</td></tr><tr ><td style="color: #161120;text-align: center;">12</td><td style=";">YYSI</td><td style="text-align: center;;">8</td><td style="text-align: center;;">-</td><td style="text-align: center;;">9</td><td style="text-align: center;;">2</td><td style="text-align: center;;">2</td><td style="text-align: center;;">5,25</td><td style="text-align: right;;"></td><td style="text-align: center;;">1 absence and 2 lost</td></tr><tr ><td style="color: #161120;text-align: center;">13</td><td style=";">ORZK</td><td style="text-align: center;;">6</td><td style="text-align: center;;">10</td><td style="text-align: center;;">10</td><td style="text-align: center;;">10</td><td style="text-align: center;;">8</td><td style="text-align: center;;">8,80</td><td style="text-align: right;;"></td><td style="text-align: center;;">average</td></tr><tr ><td style="color: #161120;text-align: center;">14</td><td style=";">BFQP</td><td style="text-align: center;;">3</td><td style="text-align: center;;">5</td><td style="text-align: center;;">10</td><td style="text-align: center;;">7</td><td style="text-align: center;;">7</td><td style="text-align: center;;">6,40</td><td style="text-align: right;;"></td><td style="text-align: center;;">1 lost</td></tr><tr ><td style="color: #161120;text-align: center;">15</td><td style=";">RDAP</td><td style="text-align: center;;">7</td><td style="text-align: center;;">3</td><td style="text-align: center;;">10</td><td style="text-align: center;;">4</td><td style="text-align: center;;">5</td><td style="text-align: center;;">5,80</td><td style="text-align: right;;"></td><td style="text-align: center;;">2 lost</td></tr><tr ><td style="color: #161120;text-align: center;">16</td><td style=";">NHAL</td><td style="text-align: center;;">-</td><td style="text-align: center;;">7</td><td style="text-align: center;;">-</td><td style="text-align: center;;">3</td><td style="text-align: center;;">7</td><td style="text-align: center;;">5,67</td><td style="text-align: right;;"></td><td style="text-align: center;;">2 absence and 1 lost</td></tr><tr ><td style="color: #161120;text-align: center;">17</td><td style=";">FFIG</td><td style="text-align: center;;">7</td><td style="text-align: center;;">4</td><td style="text-align: center;;">5</td><td style="text-align: center;;">5</td><td style="text-align: center;;">8</td><td style="text-align: center;;">5,80</td><td style="text-align: right;;"></td><td style="text-align: center;;">1 lost</td></tr><tr ><td style="color: #161120;text-align: center;">18</td><td style=";">TTNN</td><td style="text-align: center;;">6</td><td style="text-align: center;;">-</td><td style="text-align: center;;">-</td><td style="text-align: center;;">10</td><td style="text-align: center;;">-</td><td style="text-align: center;;">8,00</td><td style="text-align: right;;"></td><td style="text-align: center;;">3 absence</td></tr></tbody></table><p style="width:3,6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Foaie2</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G2</th><td style="text-align:left">=AVERAGE(<font color="Blue">B2:F2</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G3</th><td style="text-align:left">=AVERAGE(<font color="Blue">B3:F3</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G4</th><td style="text-align:left">=AVERAGE(<font color="Blue">B4:F4</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G5</th><td style="text-align:left">=AVERAGE(<font color="Blue">B5:F5</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G6</th><td style="text-align:left">=AVERAGE(<font color="Blue">B6:F6</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G7</th><td style="text-align:left">=AVERAGE(<font color="Blue">B7:F7</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G9</th><td style="text-align:left">=AVERAGE(<font color="Blue">B9:F9</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G10</th><td style="text-align:left">=AVERAGE(<font color="Blue">B10:F10</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G11</th><td style="text-align:left">=AVERAGE(<font color="Blue">B11:F11</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G12</th><td style="text-align:left">=AVERAGE(<font color="Blue">B12:F12</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G13</th><td style="text-align:left">=AVERAGE(<font color="Blue">B13:F13</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G14</th><td style="text-align:left">=AVERAGE(<font color="Blue">B14:F14</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G15</th><td style="text-align:left">=AVERAGE(<font color="Blue">B15:F15</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G16</th><td style="text-align:left">=AVERAGE(<font color="Blue">B16:F16</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G17</th><td style="text-align:left">=AVERAGE(<font color="Blue">B17:F17</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">G18</th><td style="text-align:left">=AVERAGE(<font color="Blue">B18:F18</font>)</td></tr></tbody></table></td></tr></table><br />
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Something like...

=IF(COUNT(B2:F2)=0,"No exams",IF((COUNT(B2:F2)=5)*(COUNTIF(B2:F2,">=5")=5),AVERAGE(B2:F2),COUNTIF(B2:F2,"<5")&" Lost and "&COLUMNS(B2:F2)-COUNT(B2:F2)&" Absence"))

which differes a bit from your specs.
 
Upvote 0
Thank you very much. If is posible can change a litlle bit formula:
<TABLE style="WIDTH: 260pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=347><COLGROUP><COL style="WIDTH: 260pt; mso-width-source: userset; mso-width-alt: 12690" width=347><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; WIDTH: 260pt; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" height=20 width=347>1 Lost and 0 Absence 1 Lost </TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" height=20>2 Lost and 0 Absence 2 Lost</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" height=20>1 Lost and 2 Absence This is OK</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" height=20>1 Lost and 0 Absence 1 Lost</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" height=20>0 Lost and 3 Absence 3 Absence</TD></TR></TBODY></TABLE>

How can I make formula return like this. I mea without ..0 Lost or 0 Absence. It's possible?
Anyway thank you very much for your answer and your time spend with me.
 
Upvote 0
Once again "GREAT ALADIN" thank you, I modify your formula and now is OK. Now don't show 0 Lost or 0 Absence.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,245
Members
452,900
Latest member
LisaGo

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