Add indirect formula to move tabs

I'm currently using this formula and I want to be able to have it automatically move to the next week using an indirect formula.


IF(COUNTIF(Week 7::Weekly Summary::$N$24:$N$39,C$1)=0,"",COUNTIF(Week 7::Weekly Summary::$N$24:$N$39,C$1))


This is currently in B9. The formula would be dragged down. B10 would contain Week 8


When I copied the formula into notepad and did find/replace the week # and then paste into numbers cell it showed syntax error and the formula looks very differntUser uploaded file

iPhone 6s Plus, iOS 10.0.1

Posted on Oct 18, 2016 8:18 PM

Reply
10 replies

Oct 18, 2016 10:30 PM in response to Beh162

Hi Beh,


Try replacing 'Week 7::Weekly Summary::$N$24:$N$39,C$1' in the current formula in B9 with

'INDIRECT("Week "&ROW()-2&"::Weekly Summary::$N$24:$N$39,C$1")'


Don't include the single quotes (used here to mark of what is being replaced and what is to replace it).


Enter in B9, then fill down for as many rows as needed.


Regards,

Barry

Oct 19, 2016 3:52 PM in response to Barry

I'm getting an invalid reference


IF(COUNTIF(INDIRECT("Week "&ROW(cell)−2&"::Weekly Summary::$N$24:$N$39,C$1",addr-style),C$1)=0,"",COUNTIF(INDIRECT("Week "&ROW(cell)−2&"::Weekly Summary::$N$24:$N$39,C$1",addr-style),C$1))


My Tabs are labeled "Week 1, Week 2 Etc" and my Tables are all labeled "Weekly Summary"

Oct 20, 2016 5:19 PM in response to Beh162

The text (without any tokens) indicates Numbers isn't recognizing it as a 'proper' formula.


The issue appears to be that the optional arguments have been inserted by Numbers, appear as text when they are copied as part of the formula, and, as text, prevent the string from being recognozed as a formula.


For the partial version, paste it into the formula editor, then delete the parts in bold below:

B10: COUNTIF(INDIRECT("Week "&ROW(cell)−2&"::Weekly Summary::$N$24:$N$39,C$1",addr-style),C$1)


in the full version, delete the same parts in bold below both times they appear:

IF(COUNTIF(INDIRECT("Week "&ROW(cell)−2&"::Weekly Summary::$N$24:$N$39,C$1",addr-style),C$1)=0,"",COUNTIF(INDIRECT("Week "&ROW(cell)−2&"::Weekly Summary::$N$24:$N$39,C$1",addr-style),C$1))


Regards,

Barry

Oct 21, 2016 1:16 PM in response to Barry

That def helped it to add in some tokens, but I'm wondering if my issue is when I get to ::Weekly Summary:: It doesn't start to recognize any sheets, it looks like the screen shot above that isn't recognized by numbers.


I moved the formula to B1 where week #1 begins and still nothing on both formula's.


So far all my indirect formula's are giving me issues, so it must be something basic I'm missing in the formatting of how the formula reads it.

Oct 24, 2016 2:02 AM in response to Beh162

Unless you have a sheet named Week -1 containing a table named Weekly Summary, the formula above will give you a REF# error (unless it returns a differen error).


Screen shots, please:

  1. The main table showing the formula you have in B9, and with the formula editor moved off cell B9 so that any result in that cell is visible.
  2. The Weekly Summary table on the sheet (tab) referenced by the formula in the cell named above (B9), showing all of the details listed:
    The Tab for the sheet containing this table.
    The row and column headers of the table. (clicking on any cell in the table will make these show)
    The name of the table as it appears above the table.
    All Header rows and Header columns of the table. If there are no Header rows or no header columns, show at least row 1 and column A at the top and left of the table.
    Hide as many rows as necessary and as many columns as necessary to fit Cells N24 to N31 of the table into the screen shot.
  3. The Weekly Summary table for the following week, with the same details shown as listed above.


Add copies of the formula as is written in B9 and in B10.

These should be text copies, not screen shots.

Click the cell to open the Formula Editor

Press command-A to select All

Press command-C to copy.

Click in your post and go Edit (menu) > Paste and match style.


Repeat for cell B9, placing the second formula directly below the first.


If the formulas are presenting an error triangle,

Click once on the triangle to show the error message.

Select the whole message.

Copy.

Paste in your message below the two formulas.


If the second formula is presenting a different error message, repeat for that cell.


Regards,

Barry

Oct 24, 2016 6:08 PM in response to Barry

Okay well I realized in my sheet I only had up to Week 6 done on this sheet so I moved the formula into B3 & B4 so it starts with week #1.

B3:

User uploaded file

Week1:

User uploaded file

Week 2:

User uploaded file

B3::

IF(COUNTIF(INDIRECT("Week "&ROW()−2&"::Weekly Summary::$N$24:$N$39,C$1"),C$1)=0,"",COUNTIF(INDIRECT("Week "&ROW()−2&"::Weekly Summary::$N$24:$N$39,C$1"),C$1))


B4::

IF(COUNTIF(INDIRECT("Week "&ROW()−2&"::Weekly Summary::$N$24:$N$39,C$1"),C$1)=0,"",COUNTIF(INDIRECT("Week "&ROW()−2&"::Weekly Summary::$N$24:$N$39,C$1"),C$1))


User uploaded file

Oct 25, 2016 3:35 PM in response to Beh162

My bad—not reading closely enough.


Current formula in B3:

IF(COUNTIF(INDIRECT("Week "&ROW()−2&"::Weekly Summary::$N$24:$N$39,C$1"),C$1)=0,"",COUNTIF(INDIRECT("Week "&ROW()−2&"::Weekly Summary::$N$24:$N$39,C$1"),C$1))


COUNTIF part:

COUNTIF(

INDIRECT("Week "&ROW()−2&"::Weekly Summary::$N$24:$N$39,C$1") --range

,C$1) --condition


C$1 is the cell containing the condition (value to be matched), and not part of the range of cells to be searched for a match.


INDIRECT builds the range from the parts that are inside the parentheses in the 'range' line above. The invalid reference error comes from including ',C$1' inside the parentheses (and inside the quotes), something I hadn't noticed on earlier readings.


Corrected formula for B3:

IF(COUNTIF(INDIRECT("Week "&ROW()−2&"::Weekly Summary::$N$24:$N$39"),C$1)=0,"",COUNTIF(INDIRECT("Week "&ROW()−2&"::Weekly Summary::$N$24:$N$39"),C$1))


Thanks for the screen shots and views of the formula both as text and in the formula editor. Needed all to track the formula and discover the error.


Another thing that will require attention is that you alternate the names of the city and the team in row 1 of the table on the win-loss landscape sheet, but use only the team names in the win and loss columns of the weekly summary tables.


The formulas in columns B and C will both need to reference C$1 for the condition of COUNTIF.


Regards,

Barry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Add indirect formula to move tabs

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.