Fill in data depending on header name

Cruiser69

Board Regular
Joined
Mar 12, 2018
Messages
61
Office Version
  1. 365
Platform
  1. Windows
Hi all

I was wondering if anyone can help.
A vendor payment doc is created weekly to pay out vendors
Is there any way to auto fill the Comments column (F) to show multiple sale ID's as in the second example in the image attached.
This is just an example sheet as there can be up to 9 sales per week with up to 50 different vendors in each sale.
It gets very time consuming filling each comment cell with the same vendor in multiple sales
Any cell with data to reference the column header and any blank cells, just leave blank.


Thanks for looking

Regards,

Graham
 

Attachments

  • payment1.JPG
    payment1.JPG
    137.6 KB · Views: 36

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Thanks Fluff.

I think I have added it correctly

Vendor payment temp.xlsx
ABCDEFGHIJK
1SALE I.DVENDOR REF Pay Y/N NOT SOLD NEW REF COMMENTSSALE04SALE05SALE06SALE07SALE08
2SALE0114051N14051
3SALE01AMAZNAMAZ
4SALE01CJWY1CJW1
5SALE01COUNCOUCOU
6SALE01DOCY
7
8SALE02JL1NJL1JL1JL1
9SALE02EE1NEE1
10SALE02ST2NST2ST2
11SALE02TUVY
12SALE02WA2Y
13
14
15
16How it should look
17
18SALE I.DVENDOR REF Pay Y/N NOT SOLD NEW REF COMMENTS SALE04 SALE05 SALE06 SALE07 SALE08
19SALE0114051NMore in SALE0414051
20SALE01AMAZNMore in SALE05AMAZ
21SALE01CJWY1CJW1
22SALE01COUNMore in SALE07, SALE08COUCOU
23SALE01DOCY
24
25SALE02JL1NMore in SALE05, SALE06, SALE07JL1JL1JL1
26SALE02EE1NMore in SALE04EE1
27SALE02ST2NMore in SALE04, SALE07ST2ST2
28SALE02TUVY
29SALE02WA2Y
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K10Celldoes not contain a blank value textNO
K8:K9Celldoes not contain a blank value textNO
I27Celldoes not contain a blank value textNO
G19:J26,J27,G27:H27,G28:J29,K19:K29Celldoes not contain a blank value textNO
C18:C29Other TypeColor scaleNO
I10Celldoes not contain a blank value textNO
G2:J9,J10,G10:H10,K2:K7,G11:K12Celldoes not contain a blank value textNO
C1:C12Other TypeColor scaleNO


Regards,

Graham
 
Upvote 0
Thanks for that & for updating your profile.
As you are using 2016 you don't have the textjoin function, so a UDF would probably be easier, is that ok?
 
Upvote 0
In that case, how about
+Fluff v2.xlsm
ABCDEFGHIJK
1SALE I.DVENDOR REF Pay Y/N NOT SOLD NEW REF COMMENTSSALE04SALE05SALE06SALE07SALE08
2SALE0114051NMore in SALE0414051
3SALE01AMAZNMore in SALE05AMAZ
4SALE01CJWY1CJW1 
5SALE01COUNMore in SALE07, SALE08COUCOU
6SALE01DOCY 
7 
8SALE02JL1NMore in SALE05, SALE06, SALE07JL1JL1JL1
9SALE02EE1NMore in SALE04EE1
10SALE02ST2NMore in SALE04, SALE07ST2ST2
11SALE02TUVY 
12SALE02WA2Y 
Main
Cell Formulas
RangeFormula
F2:F12F2=IF(COUNTA(G2:K2),"More in "&TEXTJOIN(", ",1,FILTER($G$1:$K$1,G2:K2<>"","")),"")
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,065
Messages
6,122,945
Members
449,095
Latest member
nmaske

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