IF Formula

eramirez148

Board Regular
Joined
Aug 17, 2022
Messages
54
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
  6. 2011
  7. 2010
Platform
  1. Windows
  2. MacOS
Is there a possible formula that will give me the following results in column A.
If the values from column B to column I are all zeros then the result should be zero. But if the values are higher than zero I want it to populate all the values except the zeros.


Column AColumn BColumn CColumn DColumn EColumn FColumn GColumn HColumn I
20, 19, 5, 8, 10
20​
19​
0​
0​
5​
8​
10​
0​
0​
0​
0​
0​
0​
0​
0​
0​
0​
 
With Peter's comment and the header, it would've been easier ..
Exactly why I asked the question about headers. ;)


One thing I notice is that the result is not in numerical value ...
I wonder if you actually mean numerical order?

24 04 07.xlsm
ABCDEFGHIJKLMNOPQR
1Root causes FlaggedNumber of instances product was out of stockRoot CauseInitial StockBalanceRoot CauseDelivered Quantity against STOBalanceRoot CauseSTO QuantityBalanceRoot CauseStore Order ForecastBalanceRoot CauseAdjustments to available stockBalanceRoot Cause
210, 11, 12, 1801872090.4710326620.2311326620.230326620.2312-6870.210
3000000000000000000
Root Causes
Cell Formulas
RangeFormula
A2:A3A2=TEXTJOIN(", ",,SORT(FILTER(B2:R2,($B$1:$R$1="Root Cause")*(B2:R2<>0),0),,,1))


Not sure how many rows of data you have but another option with 365 is to use this formula in the first cell and all the results will fill down without having to copy the formula down.

24 04 07.xlsm
ABCDEFGHIJKLMNOPQR
1Root causes FlaggedNumber of instances product was out of stockRoot CauseInitial StockBalanceRoot CauseDelivered Quantity against STOBalanceRoot CauseSTO QuantityBalanceRoot CauseStore Order ForecastBalanceRoot CauseAdjustments to available stockBalanceRoot Cause
210, 11, 12, 1801872090.4710326620.2311326620.230326620.2312-6870.210
3000000000000000000
Root Causes (2)
Cell Formulas
RangeFormula
A2:A3A2=BYROW(B2:R3,LAMBDA(r,TEXTJOIN(", ",,SORT(FILTER(r,(B$1:R$1="Root Cause")*(r<>0),0),,,1))))
Dynamic array formulas.



And if you comment was not about putting the values in numerical order, the "spill down" formula would be
Excel Formula:
=BYROW(B2:R3,LAMBDA(r,TEXTJOIN(", ",,FILTER(r,(B$1:R$1="Root Cause")*(r<>0),0))))
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,215,219
Messages
6,123,683
Members
449,116
Latest member
HypnoFant

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