Do I need a IF statement??

GRAY1026

New Member
Joined
Jul 19, 2021
Messages
9
Office Version
  1. 365
Please take a look at the column I highlighted in orange.

In Column S cell 3 I have concatenated the cells that I need to be in that column. However, for example if there was no data in columns W-AE how can I write my formula so it only pulls the columns that have a data entered in them.

I work in Supply chain and in order to upload items into our system I need to tell the system the unit of Measures that we can purchase for a item. This line "| " must separate each UOM.
EA-Each
BX-Box
CS-CS
So some items may only have 1 purchase unit of measure or 2 UOMs so I would leave the rest of the columns blanks. Im assuming an If statement would work here but I do no know how to write it.

Can you help?
 

Attachments

  • Do I use a IF statement.PNG
    Do I use a IF statement.PNG
    22.2 KB · Views: 9

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I also forgot to Mention I cannot have the "|" sitting there when there is no data listed.
1627321477260.png
 
Upvote 0
Hi & welcome to MrExcel.
How about
Excel Formula:
=TEXTJOIN("|",,T3&V3,W3&Y3,Z3&AB3,AC3&AE3)
 
Upvote 0
What version of Excel are you using? Your profile shows 365
 
Upvote 0
That's 2016 not 365, I would suggest that you change your profile.
As 2016 does not have textjoin, try
Excel Formula:
=MID(IF(T3<>"","|"&T3&V3,"")&IF(W3<>"","|"&W3&Y3),2,99)
 
Upvote 0
ok Thank you. Sorry I had initially thought it was 365 when I signed up. I got the formula to work but now I am getting FALSE if there is no data in the other columns. I dont want any data to return if there is nothing. I just need to make sure I have "|" at the end.
1627323362042.png
 
Upvote 0
What is the formula that you are using?
Also in future rather than posting images, it's better to post actual data to the site.

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
I apologize. I am using a Company owned laptop and I do not see that option to add the Add in. This is the formula I am using below. Is there another way I can get the file to you?
1627326351196.png
 
Upvote 0

Forum statistics

Threads
1,215,429
Messages
6,124,840
Members
449,193
Latest member
MikeVol

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