Forum Discussion

jhcj's avatar
jhcj
Copper Contributor
Dec 05, 2024
Solved

Mutiplying values based on criteria

Hi all, appreciate some help. I'm trying to get excel to multiply values in column M with column G based on criterias in column E and F.    For example, If item type is 20DV and category is Y, the...
  • m_tarler's avatar
    m_tarler
    Dec 05, 2024

    so there are few ways and assuming you don't need any particular exceptions for having combinations that don't exist or have multiple options your could use FILTER.  I will use [ ] to indicate the related cells on that sheet and LU[ ] to indicate the LookUp table values so something like:

    =[# cont] * FILTER( LU[multiplier], (LU[type]=[Cont type])*(LU[category]=[ODG]), 0)

    but that said I like where Peter was going with using a formula to calculate the multiplier instead of a lookup.  Based on the pattern I see I might say:

    =LET(
        TypeFactor, IFERROR( LEFT( [Cont type], 1) / 2 , 0),
        CatFactor, SWITCH( [ODG], "Y", 2 , "N", 1 , "OHOW", 4, "OHOW2", 6 , 0),
        [# cont] * TypeFactor * CatFactor
        )

     

     

Resources