- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
For loop without programming and coding
Hey there,
I have 3 columns (i, j, and k), could you help how to use the "for" formula (without programming and coding) to make a loop and link between these columns?
Regards,
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: For loop without programming and coding
I'm afraid I still don't understand what your resulting column should look like.
You've written:
Z(i,j) = x * 5y;
and you've said that you want:
- i to go from 0 to 90
- j to go from 0 to 180
So, do you want your z column filled with:
z(0,0) = 0 * 5 * 0 = 0
...
z(90, 180) = 90 * 5 * 180 = 81000
As @Craige_Hales pointed out, the For() function isn't (generally speaking) appropriate for use in a formula column, nor is it required.
In this case you should use the Count() or Sequence() functions in an i column and a j column to build a data table with your i and j sequences and then a z column with the formula:
i * 5 * j
Edit: Attaching a data table that shows Count() and Sequence() columns.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: For loop without programming and coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: For loop without programming and coding
I'm afraid I still don't understand what your resulting column should look like.
You've written:
Z(i,j) = x * 5y;
and you've said that you want:
- i to go from 0 to 90
- j to go from 0 to 180
So, do you want your z column filled with:
z(0,0) = 0 * 5 * 0 = 0
...
z(90, 180) = 90 * 5 * 180 = 81000
As @Craige_Hales pointed out, the For() function isn't (generally speaking) appropriate for use in a formula column, nor is it required.
In this case you should use the Count() or Sequence() functions in an i column and a j column to build a data table with your i and j sequences and then a z column with the formula:
i * 5 * j
Edit: Attaching a data table that shows Count() and Sequence() columns.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: For loop without programming and coding
We're going to need some more details here about what you mean by "loop and link between these columns."
Can you share a mocked up example of the table you have and what you want as a result?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: For loop without programming and coding
The formula editor for the Z column is inside an implied loop that runs for every row in the table; you might be able to just write
x + 5*y
as the Z column formula to get the x and y values from the same row.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: For loop without programming and coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: For loop without programming and coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: For loop without programming and coding
I'm not seeing attachments.
But now I'm imagining your table might be similar to this set of columns:
ILatitude JLongitude Temp Wind FeelsLikeCalculatedFromTempAndWind
where the lat/lon (i and j) have no bearing on the calculated value which is only depending on temp and wind. But you might want to use them on a contour plot of FeelsLike by lat,lon. If that's similar to your data, use a simple column formula for FeelsLike and then make the contour plot from lat, lon, FeelsLike.