How to Add Categories Based on Attribute Values
Goal: Automatically assign products to categories based on their attribute values (e.g., assign all products with a special price to a "Sale" category).
Prerequisites
- Excel with cobby installed
- Products loaded in Excel
- Target category already exists in your store
Steps
1. Create Helper Columns
- Locate your Categories column in Excel
- Insert two new columns to the right of the Categories column
- Name the columns:
- First column: "Current Categories"
- Second column: "Conditional Category"
2. Preserve Current Categories
- Select the entire Categories column
- Copy all entries
- Paste into the Current Categories helper column
- This preserves existing category assignments
3. Create Conditional Formula
- Click the first cell in the Conditional Category column
- Create an IF formula to check your condition
Example: Add "Sale" category when Special Price is set:
=IF([@[Special Price]]>0;"|Root/Sale";"")
Formula breakdown:
[@[Special Price]]>0- Checks if Special Price is greater than 0"|Root/Sale"- Category path to add if condition is TRUE""- Empty string if condition is FALSE
4. Find the Correct Category Path
To get the exact category path:
- Manually assign the desired category to any test product
- Click on that product's category cell
- Copy the category value from the formula bar
- Use this exact format in your formula
5. Apply Formula to All Products
- Select the cell with your formula
- Double-click the fill handle (small square at bottom-right of cell)
- Or drag the fill handle down to apply to all rows
- The formula will apply to all products in the table
6. Merge Categories
- Click the first cell in the Categories column
- Use the CONCATENATE function to merge both helper columns:
=CONCATENATE([@[Current Categories]];[@[Conditional Category]])
- Change the cell format to Standard (not Text):
- Select the cell
- Go to Home tab
- Set format dropdown to "Standard"
7. Apply and Save
- Double-click the fill handle to apply the merge formula to all products
- Verify categories appear correctly
- Click Save products in cobby to sync to your store
Examples
Add Category Based on Manufacturer
=IF([@Manufacturer]="Nike";"|Root/Brands/Nike";"")
Add Multiple Categories Based on Price Range
=IF([@Price]>100;"|Root/Premium";IF([@Price]<20;"|Root/Budget";""))
Add Category Based on Stock Status
=IF([@Qty]<5;"|Root/Low Stock";"")
Troubleshooting
Categories not appearing after save
- Verify category path format matches exactly (use formula bar method)
- Check that categories exist in your store
- Ensure cell format is "Standard" not "Text"
Existing categories are lost
- Make sure you copied current categories to helper column first
- Verify CONCATENATE formula references the correct helper column
Formula shows as text
- Change cell format from "Text" to "Standard"
- Re-enter the formula after changing format
Condition not working as expected
- Test your IF condition on a single product first
- Check attribute column names match exactly
- Verify data types (numbers vs text)
Advanced Tips
Multiple conditions: Use nested IF or AND/OR functions:
=IF(AND([@[Special Price]]>0;[@Qty]>10);"|Root/Sale";"")
Category combinations: Add multiple categories:
=IF([@Brand]="Nike";"|Root/Brands/Nike|Root/Athletic";"")
Remove categories: Use empty string to skip assignment:
=IF([@Status]="Disabled";"";"")