简体   繁体   中英

Excel Formula - Auto Add cell +1 counting (part 2)

Hello Excel Experts Again-

I have a second (follow up) question from Excel Formula - Add cell + ".jpg" based on value in B1 and C1 is blank - and not sure if it's possible, but would there be a way to have the product parent sku (from say B1) be entered in C2 thru C7 (taken from B1) if column B = sku-1, sku-2, sku-3 etc. Then this would continue as B09 changes Product Parent SKU so therefore C10-15 would contain B09 and B10 thru B15 would auto count B09++1

And with that in mind- do you know of any way or is there anyway to make the product SKU auto count after the parent is entered in B1 (B2 thru B7) only if values are added to column N (as you can see the sizes go up from 2-7)

This would possible be the biggest time saver of them all. I'm already grateful for the help in the above answer!

B                   C                 M                          N
01 cws-jun-0001                     Color::1|Size::2    
02 cws-jun-0001-1       cws-jun-0001                        Color::White-Red|Size::2T
03 cws-jun-0001-2       cws-jun-0001                        Color::White-4 Red|Size::3T
05 cws-jun-0001-3       cws-jun-0001                        Color::White-Red|Size::4T
06 cws-jun-0001-4       cws-jun-0001                        Color::White-Red|Size::5T
07 cws-jun-0001-5       cws-jun-0001                        Color::White-Red|Size::6
08 cws-jun-0001-6       cws-jun-0001                        Color::White-Red|Size::7
09 cws-jun-0002                     Color::1|Size::2    
10 cws-jun-0002-1       cws-jun-0002                        Color::White-Red|Size::2T
11 cws-jun-0002-2       cws-jun-0002                        Color::White-Red|Size::3T
12 cws-jun-0002-3       cws-jun-0002                        Color::White-Red|Size::4T
13 cws-jun-0002-4       cws-jun-0002                        Color::White-Red|Size::5T
14 cws-jun-0002-5       cws-jun-0002                        Color::White-Red|Size::6
15 cws-jun-0002-6       cws-jun-0002                        Color::White-Red|Size::7

And if the only way to do this would be to create macro- I suppose I can do that but would need a little guidance on the order of steps to take

The following will depend a bit on whether your actual data conforms to the patterns exhibited by the sample data you provided. If there are sufficient differences to render this solution useless, some text parsing routines could take care of missed matches.

With cws-jun-0001 in B1, put the following formula into B2 and fill down.

=LEFT(B1, 12)&TEXT(COUNTIF(B$1:B1, LEFT(B1, 12)&"*"), "\\-0")

SKU递增

Next, type any new SKU into one of the cells in the column. Example: cws-jun-0002 into B8.

SKU递增II

The numbering sequence is automatically restarted with the new SKU.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM