if cell has any value, then return text in different cell

liloo

New Member
Joined
May 2, 2021
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

I created a simple table to illustrate the data I have in my original workbook. In my workbook, this table is pulled from another sheet using VLOOKUP. The values are quantity purchased by each company. "-" indicates the company did not purchase anything in said year for said product. "0" indicates the company did purchase said product, in a particular quarter of the year.

I would like to show in a new column the tally for each company. I want to write a formula that would spit out "2019Q4_A, 2019Q2_B, 2020Q2_B, 2020Q4_C" for ABC Inc. I don't know where to start. I've been looking up different functions and imagine this may be a combination of VLOOKUP, ISNUMBER and COUNTIF???

Any guidance is much appreciated!


Book1.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXY
12019Q1 Product A2019Q2 Product A2019Q3 Product A2019Q4 Product A2019Q1 Product B2019Q2 Product B2019Q3 Product B2019Q4 Product B2019Q1 Product C2019Q2 Product C2019Q3 Product C2019Q4 Product C2020Q1 Product A2020Q2 Product A2020Q3 Product A2020Q4 Product A2020Q1 Product B2020Q2 Product B2020Q3 Product B2020Q4 Product B2020Q1 Product C2020Q2 Product C2020Q3 Product C2020Q4 Product C
2ABC Inc00040600--------0100000020
3DEF Corp----1002----10000050----
4GHI Ltd10000------------0100000500
5JKL Enterprise01010202----01006000----
6MNO Ltd------------00200008----
Sheet1
 
Great. Happy it worked.

If there's a change NONE of the periods would have a value, you might want to change the formula to:

Code:
=IFERROR(TEXTJOIN(", ",TRUE,FILTER($B$1:$Y$1,(B2:Y2>0)*(B2:Y2<>"-"))),"")
 
Upvote 0
Solution

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Great. Happy it worked.

If there's a change NONE of the periods would have a value, you might want to change the formula to:

Code:
=IFERROR(TEXTJOIN(", ",TRUE,FILTER($B$1:$Y$1,(B2:Y2>0)*(B2:Y2<>"-"))),"")
I'm back with a follow-up question.

Now in an effort to simplify the results, is there a way to write a formula that will result in JKL Enterprise's summarized purchase to "A 1H19, A 2H19, B 1H19, B 2H19, A 1H20, B 1H20"?
I started with =IF(OR(ISNUMBER(SEARCH("2019Q1 Product A", Z2)), ISNUMBER("2019Q2 Product A", Z2))), "A 1H19", ""), I don't know how to tag on the other conditions.
*Column Z being where the TEXTJOIN formula is housed.
 
Upvote 0

Forum statistics

Threads
1,214,534
Messages
6,120,080
Members
448,943
Latest member
sharmarick

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