Forum Discussion
IF statement based on multiple columns.
I'm pretty sure someone will have a more eloquent formula but this can be done with nested IF formula - see attached example
=IF($A2>"",$A2,IF($B2>"",$B2,IF($C2>"",$C2,0)))
- RaquelJNov 04, 2023Copper Contributor
Hi Charla74 ,
How about if statement to add multiple columns? how to summarize it.
Thank you so much.
- LorenzoNov 04, 2023Silver Contributor
If you're on Windows with Excel >/= 2016 or on Mac with Excel 365 (up to date) there's a better solution (sample attached) without changing the way you record data. The below data are formatted https://support.microsoft.com/en-us/office/format-an-excel-table-6789619f-c889-495c-99c2-2f971c0e2370 where the Header isn't displayed:
That Table is unpivoted with Get & Transform (aka Power Query). The resulting table is used as the Source of a Pivot Table:
Main benefits: As you add new columns/rows to the data Table it's dynamically resized, picking your additional Suppliers and/or Products, no more formula, Products and Suppliers are automatically sorted in the pivot table...