Share via

Multiply based on true / false result

Anonymous
2023-10-21T15:42:03+00:00

Hi,
If I have a table with which indicates if a number is to be multiplied and then another

whoch states the amout to multiply by so;

so the first row would 2 * 2 *3 *4 and the second would be 3 * 3 what is the best way I have though of switch, obviously if I were summing each I could use an array so;

SUMPRODUCT( B5 *(C3:E3*C5:E5) )

the best i have come up with is just a lot of ifs;

any better ways, let ?

Richard.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Lz365 38,201 Reputation points Volunteer Moderator
2023-10-22T03:37:05+00:00

Hi Richard

Image

in E2 with above setup:

=PRODUCT(A2, IF(B2:D2=1, B$1:D$1)) 

or

=PRODUCT(A2, IF(B2:D2, B$1:D$1))

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Lz365 38,201 Reputation points Volunteer Moderator
    2023-10-23T06:39:35+00:00

    I did not know I could use IF on an array to get a spill of results

    With Excel versions that support dynamic arrays (currently 2021 and 365)

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-10-22T12:54:52+00:00

    Just to add, I did not know I could use IF on an array to get a spill of results,

    Thanks,

    RD

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-10-22T12:32:16+00:00

    Thank you,

    Richard.

    Was this answer helpful?

    0 comments No comments
  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more