A way to autofill sub-categories in this dataset?

parvezs27

New Member
Joined
Jun 27, 2022
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Hi everyone!

I created this food dataset below but I forgot to add food sub-categories. I am now adding sub-categories but looking for a way to autofill the sub-categories based on the values in Column D "Item". For example, if Item is "Plain Naan", the sub-category value throughout the whole sheet should be "Naans".

I tried using the IF function, =IF(D14="Non Vegetarian Tiffin","Tiffin Packs",""), but the issue was that I couldn't find a way to leave the false values unchanged when dragging the formula down the column. Everything else would get affected.

How would you guys recommend to go abouts this rather than having to input all the sub-categories one by one?

Any help would be appreciated, thank you!

Doordash Items CSV.csv
ABCDEFGHI
1ORDER_IDDATENAMEITEMCATEGORYSUB_CATEGORYSIZEQUANTITYPRICE
2696EEE6C1/06/2022Chris PPlain NaanBreadsNaansN/A12.5
3696EEE6C1/06/2022Chris PLamb VindalooCurriesLamb CurriesLarge115
4696EEE6C1/06/2022Chris PSaffron RiceRicePlain RiceN/A14
5FFC58DCA1/06/2022Priyanka JTava RotiBreadsRotisN/A11.5
6FFC58DCA1/06/2022Priyanka JChicken Curry With RiceCurry Rice PackChicken Curry Rice PackN/A110
7FFC58DCA1/06/2022Priyanka JVegetarian TiffinPacksTiffin PacksN/A112
84965A11A1/06/2022Aabiskar BNon Vegetarian TiffinPacksTiffin PacksN/A114
94965A11A1/06/2022Aabiskar BTandoori ChickenEntréeTandoor EntréeHalf111
1049FDAF271/06/2022Andrew HBeef VindalooCurriesBeef CurriesLarge115
1149FDAF271/06/2022Andrew HPeas PulaoRicePulao RiceN/A15
1249FDAF271/06/2022Andrew HPappadumsSidesCrunchy SidesN/A11
1349FDAF271/06/2022Andrew HButter ChickenCurriesChicken CurriesLarge115
1481B3D2702/06/2022Lili MNon Vegetarian TiffinPacksTiffin PacksN/A114
1581B3D2702/06/2022Lili MNon Vegetarian TiffinPacksTiffin PacksN/A114
1681B3D2702/06/2022Lili MChicken SamosaEntréeFried EntréeN/A13
1781B3D2702/06/2022Lili MGulab JamunDessertDumpling DessertsN/A14
18DD1B8F512/06/2022Marco LSaffron RiceRice N/A14
19DD1B8F512/06/2022Marco LLamb Rogan JoshCurries Large115
20DD1B8F512/06/2022Marco LButter Chicken With RiceCurry Rice Pack N/A110
213801217D2/06/2022Priyanka JVegetarian TiffinPacks N/A224
22A7404B6B3/06/2022Priyanka JVegetarian TiffinPacks N/A224
237AB78F003/06/2022Ann STava RotiBreads N/A11.5
247AB78F003/06/2022Ann SBoondi RaitaSides N/A13
257AB78F003/06/2022Ann STandoori ChickenEntrée Half111
267AB78F003/06/2022Ann SDahi BhalleDesi Specials N/A17
277AB78F003/06/2022Ann SNon Vegetarian TiffinPacksTiffin PacksN/A114
287AB78F003/06/2022Ann SPistachio KulfiDessert N/A14
2989FD504C3/06/2022Marco LOnion BhajiEntrée N/A12
3089FD504C3/06/2022Marco LTava RotiBreads N/A11.5
3189FD504C3/06/2022Marco LSaffron RiceRice N/A14
3289FD504C3/06/2022Marco LChicken KormaCurries Large115
3389FD504C3/06/2022Marco LBeef Curry With RiceCurry Rice Pack N/A112
3480CB63454/06/2022Ravi RPaneer PakoraEntrée N/A13
3580CB63454/06/2022Ravi RSaag PaneerCurries Small16
3680CB63454/06/2022Ravi RKadhai PaneerCurries Small17
3780CB63454/06/2022Ravi ROnion BhajiEntrée N/A12
3880CB63454/06/2022Ravi RVegetarian ThaliPacks N/A111
Doordash Items CSV
Cell Formulas
RangeFormula
F14:F15,F18:F38F14=IF(D14="Non Vegetarian Tiffin","Tiffin Packs","")
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi,
Create a new table with 2 columns. Add all categories and sub categories. Than use VLOOKUP in main table for match values.
 
Upvote 0
Solution
Hi,
Create a new table with 2 columns. Add all categories and sub categories. Than use VLOOKUP in main table for match values.
Thanks for the response! Would there be an issue here because some categories contain multiple sub-categories? e.g. The category bread has "Naans" and "Rotis".
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top