Custom columns

Vegas01

New Member
Joined
Jun 15, 2021
Messages
43
Office Version
  1. 2019
Platform
  1. Windows
Hi everyone

I am trying to copy column M into the Custom column and I am 90% there with what I want to achieve.

I need to get the number 14 into column "Custom" by itself, the 14 is the number of weeks in a year. This is going to change each week.

As you can see in the code I currently have it is hard coded and will not work in week 15.

So how do I get this code to work for the other weeks of the year?

Thanks in advance

= Table.AddColumn(#"Filled Down", "Custom", each if [M] = "No: 14" then "No: 14" else null)

1634263886462.png
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Try the following (assuming all week cell values are starting with "No:").

Power Query:
= Table.AddColumn(#"Filled Down", "Custom", each if Text.StartsWith(Text.From([M])??"", "No:") then [M] else null)
 
Upvote 0
if you just want the number in [Custom] try

Power Query:
 = Table.AddColumn(#"Filled Down", "Custom", each if Text.StartsWith(Text.From([M])??"", "No:") then Number.FromText(Text.End([M],Text.Length([M])-4)) else null),

or

Power Query:
= Table.AddColumn(#"Filled Down", "Custom", each if Text.StartsWith(Text.From([M])??"", "No:") then Number.FromText(Text.Replace([M],"No: ","")) else null)
 
Upvote 0
Solution

Forum statistics

Threads
1,223,698
Messages
6,173,897
Members
452,536
Latest member
Chiz511

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