Forum Discussion
Duplicate Row if any data in particular cell
I wish to duplicate the Row if there is a barcode in G to N so I can then have 3 rows for a title if it has three copies. 6 rows for a title if it has 6 rows [barcodes?] etc.
...
Ok, using filter & copy and paste I now have sheets for each column G to N.
Would it be easier to merge those sheets into the first one?
Using say the ISBN to copy the row from each sheet and insert it under the original?
Before you take any further action, actions that may or may not actually be necessary, why don't you. back up and tell us what your purpose or goal is. You're proposing (or taking) actions manually to break things apart (for what reason?) when Excel can actually do a LOT of that kind of heavy lifting itself from a well designed data table.
It sounds as if you're starting point--that 3,000 rows of book data-- could serve just fine as a source of data for various kinds of summary counts, etc. But you need to describe what your goal or purpose is; then let the Excel folks help with how Excel can do the work.
You are quite correct in what you say! I know there will be a way to do it more elegantly than what I am able to do with my very basic Excel knowledge.
I wish to compare a list of books from a library system with a list of books (the spreadsheet)
The spreadsheet has one ISBN per row and is an export from an old library system.
Each row has multiple barcodes in columns F to N, but only one copy of the Bibliographic info - ISBN, Author, Title etc. Columns A to E.
I wanted to duplicate columns A to E if there was info in rows G to N.
| Isbn | First Author | Title | Classification | Section | Barcode | Barcode 2 | Barcode 3 | Barcode 4 | Barcode 5 | Barcode 6 | Barcode 7 | Barcode 8 |
| 9780140621167 | Poe, Edgar Allan | Selected Tales | E POE | Explore | R07862K0554 | R07861J0554 | R07860A0554 | R07859W0554 | R07858F0554 | R05666K0554 | R05667L0554 | R05668M0554 |
So in that example above it would duplicate that row seven times.
That's part 1!
Part 2 would be replace the barcode Field in the second row from barcode 2, replace the barcode field in row 3 from Barcode 3 etc etc.
- mathetesAug 16, 2023Gold Contributor
You're giving us what I'd call a "procedural" or "mechanical" answer to my question of "What are you trying to accomplish?"
I know you want to compare two lists, a list of books from a library system with a list of books (the spreadsheet), but I'm trying to find out what it is that this multiplication of rows is going to do that can't be done with the data as it exists.
Said another way--or perhaps it's a different question--what kind of comparison are you trying to do that causes you to think you need multiple rows per book.
Said another way, what might the final output look like?
Try to answer those last two questions in plain ol' English, i.e., without reference to rows and columns in Excel. Don't try to do the Excelling for us; let us do that.
(For the record, these are the kinds of questions I'd be asking if we were sitting down face-to-face.)
- crankcallerAug 16, 2023Copper ContributorThe person who compiled the spreadsheet has possibly messed up somewhere. Not me i'm glad to say - but i'm having to fix it!
The items were imported into a new system from the spreadsheet and some titles have the wrong barcode entirely.
We know this as when you search for some items with the book in front of you the barcode doesn't match, they are for a different item entirely. I checked the titles in question on the original spreadsheet and they are wrong there as well - so presumably it wasn't an error when the spreadsheet was mapped to the database.
I wish to scan the ISBN and barcode from each physical item into a file. This will give me the correct info.
I then wish to compare that to the system and original spreadsheet.
Because of multiple copies of items with the same ISBN I wanted one per row - I assumed it would be easier to compare the multiple copies by sorting by ISBN.
Sorry if this is too much info - I've been at this a while today and my head is fried!- mathetesAug 16, 2023Gold Contributor
Sorry if this is too much info - I've been at this a while today and my head is fried!
I understand. Reading what you've written, my head is spinning. But I have a question, based on the following two statements:
I wish to scan the ISBN and barcode from each physical item into a file. This will give me the correct info.
I then wish to compare that to the system and original spreadsheet.Once you have the correct info, after scanning each physical item, what's the purpose of comparing with the system and the original spreadsheet? You have the correct info; why not stop there? What additional value is achieved by comparing the correct info with info you know not to be fully reliable?