May 18 2023 02:17 AM
Hey Guys
Hope all are well. I need to formula and I'm having trouble.
So if A is a date. If B,C,D say yes I want to add 2 weeks on from A into E. If that makes.
thanks in advance.
May 18 2023 02:37 AM
A basic solution might be
= IF((ColumnB = "Yes") * (ColumnC = "Yes") * (ColumnD = "Yes"), ColumnA + 14, "")
May 18 2023 02:44 AM
@PeterBartholomew1 Hi Pete.
Looking at this little closer. I only need 1 Column to say yes. so what would that formula be? I've attempted to amend but I'm getting a spill error
May 18 2023 02:48 AM - edited May 18 2023 02:48 AM
Change the formula to
= IF((ColumnB = "Yes") + (ColumnC = "Yes") + (ColumnD = "Yes"), ColumnA + 14, "")
Replace ColumnA, ColumnB etc. with the ranges that you use.
Alternatively, enter the following formula in for example E2, then fill down:
= IF(OR(B2:D2 = "Yes"), A2 + 14, "")
May 18 2023 02:54 AM - edited May 18 2023 03:03 AM
Because I use Excel 365, what I would actually do is name column A to be 'date' and the 3 columns of "Yes/No"s to be something like 'status'.
= IF(BYROW(status = "Yes", ORλ), date+14, "")
where
ORλ
= LAMBDA(x, OR(x))
That might look somewhat less familiar though!
Note: the names I use are applied to occupied data cells, not entire columns.
Thanks go to @HansVogelaar
May 18 2023 02:56 AM
May 18 2023 02:59 AM
For example
=ColumnA + IF((ColumnB = "Yes") + (ColumnC = "Yes") + (ColumnD = "Yes"), 14, 7)
or
=A2 + IF(OR(B2:D2="Yes"), 14, 7)
May 18 2023 04:43 AM
Clearly as your requirements get more complex the solutions will need to be reworked to capture the intent of the formula. At the moment, a simple modification will suffice. I have converted the input to a Table so that it grows with new data. The result is a separate dynamic array which will grow along with the Table.