Concatenate while using index match and if statements

andrekel

New Member
Joined
Nov 17, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello forum,

I have a workbook, that I use to import data into our ERP. I have 3 columns(E,F,G) that I will input a number into. I want to concatenate the 3 columns in Column H. While inputting nothing if the column is empty.

AssortmentTiers-Products_Warehouses.xlsx
EFGH
1Depot 1Depot 2Depot 3Warehouses/ID
2123114115__export__.stock_warehouse_51_ced98dd7,,115
3
Sheet2
Cell Formulas
RangeFormula
H2H2=(INDEX(warehouses!$A:$A,MATCH(E2,warehouses!$B:$B,0)))&IF(F2<>"",",",INDEX(warehouses!$A:$A,MATCH(F2,warehouses!$B:$B,0)))&IF(G2<>"",","&G2,"""""")


Not getting the results, I want. It is not pulling in the 2nd index match. The delimiter(comma) shows but the index-match is blank. When I remove the delimiter it works, but I need the comma to make sure the import works correctly.

Here it is with the delimiter(comma) removed.

AssortmentTiers-Products_Warehouses.xlsx
EFGH
1Depot 1Depot 2Depot 3Warehouses/ID
2123114115__export__.stock_warehouse_51_ced98dd7__export__.stock_warehouse_38_4318f5b3,115
3
Sheet2
Cell Formulas
RangeFormula
H2H2=(INDEX(warehouses!$A:$A,MATCH(E2,warehouses!$B:$B,0)))&IF(F2<>"",INDEX(warehouses!$A:$A,MATCH(F2,warehouses!$B:$B,0)))&IF(G2<>"",","&G2,"""""")


As you see it works like it should, but the comma is missing.

Where am I going wrong. Any help would be greatly appreciated.

Thank you,

André
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Missing &

I think it should be
=IF(E2<>"",INDEX(.....),"")&IF(F2<>"",","&INDEX(.........),"")&IF(G2<>"",","&G2,"")

M.
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,124
Members
453,021
Latest member
Justyna P

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