Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 05-11-2022, 02:08 AM
ArviLaanemets ArviLaanemets is offline sorting cells in excel into specific columns Windows 8 sorting cells in excel into specific columns Office 2016
Expert
 
Join Date: May 2017
Posts: 960
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

Let's analyze the formula in Sheet2!A2
Code:
OFFSET(Sheet1!$A$1;4*(ROW()-ROW($A$1))+0;0)
Offset returns a value a number of rows and columns from anchor cell;
1) The anchor cell here is Sheet1!$A$1. (NB! This is an absolute reference, so the anchor cell is always same when the formula is copied down.);
2) (ROW()-ROW($A$1)) returns 1 when the formula is 2nd row, 2 when the formula is in 3rd row, etc., i.e. it returns the number of current datarange row for the cell with formula;
3) 4 is the number of rows used for single product in Sheet1. When you multiply it with datarange row number in sheet2, you get the number of row which is 1 less than according product name in sheet1;
4) Adding 0 to previous number gives the number which you have to add to row number (1) of anchor cell to get the row number of product name from sheet1, With this, the 2nd parameter of OFFSET formula <4*(ROW()-ROW($A$1))+0> is covered - you get values from Sheet1 rows 5, 9, 13, etc.;
5) As all data in Sheet1 are in column A, the last parameter will be always 0.

To get quantity values, you have to get values one cell below product names. For this all remains same as above, except in p. 4) you have to replace 0 with 1. And for ItemPrice 0 with 2, etc.
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I transfer specific data from email to specific excel cells? Mauro Outlook 1 11-11-2019 09:17 PM
Linking Specific text fields in PP to specific cells in an Excel table GWRW1964 PowerPoint 0 02-26-2018 07:37 AM
sorting cells in excel into specific columns Linking cells: can sub-cells move with their master-cell when sorting? kw01 Excel 1 06-30-2015 05:02 PM
sorting cells in excel into specific columns Macro to copy specific columns in Excel from another spreadsheet KD999 Excel Programming 1 07-20-2012 08:58 AM
Sorting columns in Excel - please advise Jonre Excel 2 08-21-2009 02:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft