JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,691
- Office Version
- 365
- Platform
- Windows
I was working on a workbook to keep track of my ratings of various items I purchase. I ran into a curious problem in the snack bar sheet that I cannot figure out.
I have 2 tables. The Product table (TblProdSB) is a list of the products (snack bars in this sheet). The Log table (TblLogSB) is a list of the ratings each time I try one of the snack bars. I have simplified the tables. In all my other sheets with similar tables, if I add a new product to the Product table, the count will show zero. For some reason, this one gets a Value error. I am going to include 3 minisheets to show how this error disappears and then reappears.
Minisheet #1: Value error in D8
Minisheet #2: If I add a row to the Log table (on the right), the error disappears
Minisheet #3: If I add a new row to the Product table (on the left), the error reappears.
What is going on here?
I have 2 tables. The Product table (TblProdSB) is a list of the products (snack bars in this sheet). The Log table (TblLogSB) is a list of the ratings each time I try one of the snack bars. I have simplified the tables. In all my other sheets with similar tables, if I add a new product to the Product table, the count will show zero. For some reason, this one gets a Value error. I am going to include 3 minisheets to show how this error disappears and then reappears.
Minisheet #1: Value error in D8
CountIf.xlsx | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | |||
3 | Product Table | Usage Log Table | |||||||||
4 | Brand | Flavor | # Tried | Date | OK? | Brand | Flavor | Rating | |||
5 | Kind | Dark Chocolate Nuts & Sea Salt | 1 | 5/30/24 | Ok | Kind | Dark Chocolate Nuts & Sea Salt | 82 | |||
6 | Kind | Dark Chocolate Cherry Cashew | 1 | 5/30/24 | Ok | Kind | Dark Chocolate Cherry Cashew | 88 | |||
7 | Kind | Breakfast Bars | 1 | 5/29/21 | Ok | Kind | Breakfast Bars | 40 | |||
8 | Kind | Dark Chocolate Mint | #VALUE! | ||||||||
Snack Bars |
Cell Formulas | ||
---|---|---|
Range | Formula | |
G5:G7 | G5 | =IF(COUNTIFS(TblProdSB[Brand],[@Brand],TblProdSB[Flavor],[@Flavor])=1,"Ok","XXX") |
D5:D8 | D5 | =COUNTIFS(TblLogSB[@Brand],[@Brand],TblLogSB[@Flavor],[@Flavor]) |
Minisheet #2: If I add a row to the Log table (on the right), the error disappears
CountIf.xlsx | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | |||
3 | Product Table | Usage Log Table | |||||||||
4 | Brand | Flavor | # Tried | Date | OK? | Brand | Flavor | Rating | |||
5 | Kind | Dark Chocolate Nuts & Sea Salt | 1 | 5/30/24 | Ok | Kind | Dark Chocolate Nuts & Sea Salt | 82 | |||
6 | Kind | Dark Chocolate Cherry Cashew | 1 | 5/30/24 | Ok | Kind | Dark Chocolate Cherry Cashew | 88 | |||
7 | Kind | Breakfast Bars | 1 | 5/29/21 | Ok | Kind | Breakfast Bars | 40 | |||
8 | Kind | Dark Chocolate Mint | 0 | XXX | |||||||
Snack Bars |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D5:D8 | D5 | =COUNTIFS(TblLogSB[@Brand],[@Brand],TblLogSB[@Flavor],[@Flavor]) |
G5:G8 | G5 | =IF(COUNTIFS(TblProdSB[Brand],[@Brand],TblProdSB[Flavor],[@Flavor])=1,"Ok","XXX") |
Minisheet #3: If I add a new row to the Product table (on the left), the error reappears.
CountIf.xlsx | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | |||
3 | Product Table | Usage Log Table | |||||||||
4 | Brand | Flavor | # Tried | Date | OK? | Brand | Flavor | Rating | |||
5 | Kind | Dark Chocolate Nuts & Sea Salt | 1 | 5/30/24 | Ok | Kind | Dark Chocolate Nuts & Sea Salt | 82 | |||
6 | Kind | Dark Chocolate Cherry Cashew | 1 | 5/30/24 | Ok | Kind | Dark Chocolate Cherry Cashew | 88 | |||
7 | Kind | Breakfast Bars | 1 | 5/29/21 | Ok | Kind | Breakfast Bars | 40 | |||
8 | Kind | Dark Chocolate Mint | 0 | XXX | |||||||
9 | #VALUE! | ||||||||||
Snack Bars |
Cell Formulas | ||
---|---|---|
Range | Formula | |
G5:G8 | G5 | =IF(COUNTIFS(TblProdSB[Brand],[@Brand],TblProdSB[Flavor],[@Flavor])=1,"Ok","XXX") |
D5:D9 | D5 | =COUNTIFS(TblLogSB[@Brand],[@Brand],TblLogSB[@Flavor],[@Flavor]) |
What is going on here?