ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Excel formula similar to a loop in Basic? (https://www.excelbanter.com/excel-worksheet-functions/11828-excel-formula-similar-loop-basic.html)

Cashtime

Excel formula similar to a loop in Basic?
 
Can anyone please tell me the Excel formula structure that would give values
similar to a FOR TO loop in Basic? It's for soccer results. At the moment I
update the win, draw, and lost totals manually at the end of each column and
row.
e.g.....
For n=1 to 8
If goalsfor(n) goalsagainst(n) then win=win+1
If goalsfor(n) = goalsagainst(n) then draw=draw+1
If goalsfor(n) < goalsagainst(n) then lost=lost+1
Next n
So, I need a formula that will return the values of Win, Draw, and Lost :-)

Niek Otten

A bit difficult to judge from here. But probably you can use the DataTable
command. Look in HELP for details.

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"Cashtime" wrote in message
...
Can anyone please tell me the Excel formula structure that would give
values
similar to a FOR TO loop in Basic? It's for soccer results. At the moment
I
update the win, draw, and lost totals manually at the end of each column
and
row.
e.g.....
For n=1 to 8
If goalsfor(n) goalsagainst(n) then win=win+1
If goalsfor(n) = goalsagainst(n) then draw=draw+1
If goalsfor(n) < goalsagainst(n) then lost=lost+1
Next n
So, I need a formula that will return the values of Win, Draw, and Lost
:-)




Cashtime

Thanks Niek. After looking deeply into Help, it looks like Array formulas may
be the solution. I'll let you know if they are!

"Niek Otten" wrote:

A bit difficult to judge from here. But probably you can use the DataTable
command. Look in HELP for details.

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"Cashtime" wrote in message
...
Can anyone please tell me the Excel formula structure that would give
values
similar to a FOR TO loop in Basic? It's for soccer results. At the moment
I
update the win, draw, and lost totals manually at the end of each column
and
row.
e.g.....
For n=1 to 8
If goalsfor(n) goalsagainst(n) then win=win+1
If goalsfor(n) = goalsagainst(n) then draw=draw+1
If goalsfor(n) < goalsagainst(n) then lost=lost+1
Next n
So, I need a formula that will return the values of Win, Draw, and Lost
:-)






All times are GMT +1. The time now is 10:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com