Forum Discussion

PaulM1970's avatar
PaulM1970
Copper Contributor
Apr 24, 2024

Need help with counting the last digit of a number

Hi team!

 

Respectfully request help with the following:

 

Need a formula in cell D3 of Sheet2 that accomplishes the following:

 

If Sheet1 column D says, "Acme", count the number of times the last digit of the number in Sheet1 column C matches the number in Sheet2 column B.

 

Can't find a way to attach a sample. I'll try to post, and then edit, and see if the system allows me to attach.

  • PaulM1970 

    =SUMPRODUCT((Sheet1!$D$2:$D$1000="Acme")*(MOD(Sheet1!$C$2:$C$1000, 10)=B3))

    If you have Microsoft 365 or Office 2021, you can use SUM instead of SUMPRODUCT.

    • PaulM1970's avatar
      PaulM1970
      Copper Contributor
      Hi HansVogelaar

      Same guy. Different username here.

      How would I merge this prefix to the formula you provided?

      =COUNTIFS(Table5[Site],$B$2,
      (Table 5 is the table found on what I'm referring to as sheet1)

      B2 is a dropdown list of sites. The formula you came up with would then pull data from the sheet1 rows containing the site listed in cell B2.

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        PaulM1970 

        Could you post the version of the formula that I provided with the table references instead of the range references?

Resources