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
It's missing the false element in the 2nd IF. It should be
Excel Formula:
=MID(IF(T3<>"","|"&T3&V3,"")&IF(W3<>"","|"&W3&Y3,""),2,99)
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Great! I think we are getting closer. One last thing. If the BX of 1 is the only UOM filled in I need a "|" to be after the number. So it will read: BX1|

Is that possible.
1627328672380.png
 
Upvote 0
Do you always need a | at the end?
 
Upvote 0
In that case you can use
Excel Formula:
=IF(T3<>"",T3&V3&"|","")&IF(W3<>"",W3&Y3&"|","")
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,939
Members
449,094
Latest member
teemeren

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