Single Formula

ExcelNewbie2020

Active Member
Joined
Dec 3, 2020
Messages
354
Office Version
  1. 365
Platform
  1. Windows
Using single formula how can we transform the source data to expected output..
i need to put the amount to its respective size based on column header. thank you

Book1
ABCDEFGHIJ
1SOURCEEXPECTED OUTPUT
2NameAmountSizeNameSmallMediumLarge
3Aariz Gentry28.89SmallAariz Gentry28.89
4Wilf Klein4.05MediumWilf Klein4.05
5Vivian Dolan55.09SmallVivian Dolan55.09
6Manisha Wilkinson47.73SmallManisha Wilkinson47.73
7Ezmae Pugh11.92SmallEzmae Pugh11.92
8Ira Savage3.24SmallIra Savage3.24
9Tayyib Cervantes92.80SmallTayyib Cervantes92.80
10Luke Fitzpatrick46.80SmallLuke Fitzpatrick46.80
11Cienna Hewitt83.79LargeCienna Hewitt83.79
12Mila Davison60.10SmallMila Davison60.10
13Cassius Carty49.45MediumCassius Carty49.45
14Prisha Povey7.33SmallPrisha Povey7.33
15Amaya Mccall2.64SmallAmaya Mccall2.64
16Adaline Browne35.12SmallAdaline Browne35.12
17Eshal Oliver9.44SmallEshal Oliver9.44
Sheet7
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Try:
Excel Formula:
=PIVOTBY(A3:A17,C3:C17,B3:B17,SINGLE,,0,,0)
 
Upvote 0
Solution
Try.
Excel Formula:
=HSTACK(A3:A17,IF(C3:C17={"Small","Medium","Large"},B3:B17,""))
 
Upvote 0
Try:
Excel Formula:
=PIVOTBY(A3:A17,C3:C17,B3:B17,SINGLE,,0,,0)
it worked like a charm.. however, i noticed that there are duplicate values from my actual data under column A.
Would it be possible for pivotby to show all values in the row fields (not only unique values)? thank you very much
 
Upvote 0
noticed that there are duplicate values from my actual data under column A.
Duplicate how? If they're duplicate in A but differs in size (col C), it should still work.

Book1
ABCDEFGHIJ
1SOURCE
2NameAmountSize SmallMediumLarge
3Aariz Gentry28.89SmallAariz Gentry28.894.05
4Aariz Gentry4.05MediumAdaline Browne35.12
5Vivian Dolan55.09SmallAmaya Mccall2.64
6Manisha Wilkinson47.73SmallCassius Carty49.45
7Ezmae Pugh11.92SmallCienna Hewitt83.79
8Ira Savage3.24SmallEshal Oliver9.44
9Tayyib Cervantes92.8SmallEzmae Pugh11.92
10Luke Fitzpatrick46.8SmallIra Savage3.24
11Cienna Hewitt83.79LargeLuke Fitzpatrick46.8
12Mila Davison60.1SmallManisha Wilkinson47.73
13Cassius Carty49.45MediumMila Davison60.1
14Prisha Povey7.33SmallPrisha Povey7.33
15Amaya Mccall2.64SmallTayyib Cervantes92.8
16Adaline Browne35.12SmallVivian Dolan55.09
17Eshal Oliver9.44Small
Sheet4
Cell Formulas
RangeFormula
G2:J16G2=PIVOTBY(A3:A17,C3:C17,B3:B17,SINGLE,,0,,0,-1)
Dynamic array formulas.
 
Upvote 0
Duplicate how? If they're duplicate in A but differs in size (col C), it should still work.

Book1
ABCDEFGHIJ
1SOURCE
2NameAmountSize SmallMediumLarge
3Aariz Gentry28.89SmallAariz Gentry28.894.05
4Aariz Gentry4.05MediumAdaline Browne35.12
5Vivian Dolan55.09SmallAmaya Mccall2.64
6Manisha Wilkinson47.73SmallCassius Carty49.45
7Ezmae Pugh11.92SmallCienna Hewitt83.79
8Ira Savage3.24SmallEshal Oliver9.44
9Tayyib Cervantes92.8SmallEzmae Pugh11.92
10Luke Fitzpatrick46.8SmallIra Savage3.24
11Cienna Hewitt83.79LargeLuke Fitzpatrick46.8
12Mila Davison60.1SmallManisha Wilkinson47.73
13Cassius Carty49.45MediumMila Davison60.1
14Prisha Povey7.33SmallPrisha Povey7.33
15Amaya Mccall2.64SmallTayyib Cervantes92.8
16Adaline Browne35.12SmallVivian Dolan55.09
17Eshal Oliver9.44Small
Sheet4
Cell Formulas
RangeFormula
G2:J16G2=PIVOTBY(A3:A17,C3:C17,B3:B17,SINGLE,,0,,0,-1)
Dynamic array formulas.
thank you..duplicate in column A and with the same size in column C
 
Upvote 0
PIVOTBY is an aggregate function so it removes duplicates. Try the suggestion in post #3.
 
Upvote 0

Forum statistics

Threads
1,226,509
Messages
6,191,450
Members
453,658
Latest member
healmo

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