Sum Multiple items if condition met

This is a document library. I’m trying to have calculations in two fields using xslt that will sum the amounts in yellow (first year numbers). I also only want to be able to see one entry for each team. Any suggestions.
graphical representation of what my intent is.

google sheets – Sum column value if any of several criteria is met in the adjacent column

I have a sheet in which I have 2441 words (hashtags) on their own rows in the first column and in the next (adjacent) column, a number related to them (occurrences of the hashtag in our data).

I want to sum together the occurrences of hashtags, which mention any word from a certain list. The word can be either as part of the hashtag or the whole hashtag for the number in the adjacent column to be counted.

I searched the forum and found this helpful thread I tried to incorporate, but unfortunately I am still doing something wrong.

My current formula is:

=ArrayFormula(sum(sumif(A2:A20,{"*business*"; "*entrepeneur*";"*shop*";"*biz*";"*marketing*";"*hustle*"},B2:B20)))

As you can see from the screenshot, the formula doesn’t sum all of the instances from the given range. Have I formatted something in the formula wrong? Or well, I obviously have, but I wonder which part it is.

Sheet screenshot

formulas – Google sheets- duration between two specific times and duration after a value is met

I’m making a wage calculator and have hit a wall.

I need a couple formulas to measure duration between two specific times, and duration after a specific max number is met.

For context I’ve already managed to measure total duration between two times adjusting for past midnight, and convert everything back from duration to multiply by a pay rate to achieve gross pay.

Example spreadsheet:
https://docs.google.com/spreadsheets/d/1QY4o7RMkWGcZPNUZg5OAETtmmlm07E6yyFjFnu0Jgac/edit?usp=sharing

Any help is much appreciated!

go – Multiple input checks, repeat if conditions are not met

I’ve used this code to make some inputs checks. On any failed check, I need to ask again for proper input. I used labels and goto to achieve this, which they seem to be disliked by programmers as a concept.

How could I achieve the same effect without labels/goto? I considered putting all this code in a function and calling itself from inside, but it repeated only once for some reason – didn’t keep asking if kept getting wrong answers.

// 0 exits
var f float64
var n int
startGame := func() {
reception:
    fmt.Println()
    fmt.Print(`Give number (1-9): `)
    _, err := fmt.Scan(&f)

    // check letters or symbols
    if err != nil {
        fmt.Println("Letters or symbols not accepted")
        goto reception
    }

    // exit
    if f == 0 {
        os.Exit(0)
    }

    // check for integers only
    if f < 1 || f > 9 || f-math.Ceil(f) != 0 {
        fmt.Println("Only integer numbers between 1-9 are accepted")
        goto reception
    }

    n = int(f)
    // check for empty cells
    if myArray(n-1) == false {
        fmt.Println("Empty cell", n)
        goto reception
    }
}

Why does Bitcoin Core not let met change the label for “requested payments”?

I created a receive address, entered “fdjdsgudhsgudfhgfhdgf” without thinking about it (I was going to describe it properly later) and sent coins to it from a different wallet.

Then I later changed it to “Accurate description blabla” in the “Transactions” tab, which it allowed me to do. Then I looked in the “Receive” tab and saw that it still had the stupid gibberish label there. So I went to change the label… only to realize to my horror that there is no way to change the label there, once created… ?!

Please tell me I’m hallucinating or missing something. I’ll forever be annoyed by this if I’m somehow forced to keep that “fdjdsgudhsgudfhgfhdgf” label. Especially as it’s now renamed in the “Transactions” tab…

linux – clamav-daemon start condition failed, /var/lib/clamav/daily.{c[vl]d,inc} was not met

After installing Modoboa(Open Source Mail Hosting), I Tried to start clamav-daemon, but i faced start condition failed.

    systemctl status clamav-daemon.service
    clamav-daemon.service - Clam AntiVirus userspace daemon
   Loaded: loaded (/lib/systemd/system/clamav-daemon.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/clamav-daemon.service.d
           └─extend.conf
   Active: inactive (dead)
Condition: start condition failed at Fri 2021-01-15 04:19:06 EST; 33min ago
           └─ ConditionPathExistsGlob=/var/lib/clamav/daily.{c(vl)d,inc} was not met

Below it showed the problem, conditionPathExistsGlob=/var/lib/clamav/daily.{c(vl)d,inc} was not met.
I couldn’t start the service with systemctl or other commands.
After some troubleshoots, I found out that /var/lib/clamav is empty and there should be some .cvd update file.
Also I couldn’t update the clamav with this command (show me 403 error):

sudo clamav-freshclam

what can I do now?

google sheets – Keep cell value same if condition is not met

Set-up

I have 2 Google sheets.

Sheet 1 imports a cell value from Sheet 2 using the IMPORTRANGE function.

The cell value in Sheet 2 is updated automatically each day, 365 days a year.

Sheet 1 contains data on 1 month only.


Issue

I need to create an IF formula using the IMPORTRANGE in Sheet 1 such that the cell value in Sheet 1 keeps the data from the last day of the month if the current date is a new month.

E.g. on February 1, the cell in Sheet 1 needs to display the data from January 31 and not from February 1, even though IMPORTRANGE imports the cell value from Sheet 2 which will contain data on February 1.


Pseudo formula

So, if Sheet 1 is about January, the formula in the cell in Sheet 1 should be something along the lines of,

IF(today(month())=1;IMPORTRANGE(Sheet2_url,cell_range);DONTCHANGEVALUE)

How do I go about?

c++ – Calling a function once a threshold is met

I’m currently writing an API for our codebase that allows us to use an Arduino Leonardo for our tests. This code is uploaded to the Arduino, and we read through the analog for work.

As stated in the docstring, this function calls a passed function once a threshold has been met. However, I need there to be a delay between function calls, as signals read from the analog can fluctuate and cause the callback function to be called more than expected. So, I devised a solution that requires the signals to depreciate 1/10 of the threshold value in order for callback to be executed again. The secondFactor is if the user wants to define their own limit of when they want the function to be called again. For example:

NeuroBoard board;
board.setTriggerOnEvenlope(700, Serial.println("Reached!");

This executes the statement once 700 is reached. Then once 630 is reached (700 - (700 x .10)), it set a boolean flag so that once 700 is reached again, it will be called. For another example:

NeuroBoard board;
board.setTriggerOnEnvelope(700, Serial.println("Reached!"), 500);

Same as above, however the boolean flag will only be set once the signals reach 500.

I hope I’ve explained everything so that it’s easily understandable. If anything is unclear, please leave a comment and I’ll address it! Below is the code:

NeuroBoard.hpp (code omitted for brevity)

class NeuroBoard {

    private:
        bool thresholdMet = false;

    public:
        /**
         * Calls the passed function when the envelope value is greater 
         * than the passed threshold.
         * 
         * @param threshold Threshold for envelope value.
         * @param callback Function to call when threshold is reached.
         * @param secondFactor Optional parameter for the second threshold the data must pass.
         * 
         * @return void.
        **/
        void setTriggerOnEnvelope(const unsigned int& threshold, void callback(), const unsigned int& secondFactor=0);
}

NeuroBoard.cpp (code omitted for brevity)

The ISR is basically a timer that runs on the Arduino. I’ve configured it so every second I get about ~50,000 readings from the analog per second. The envelopeValue is the highest reading recorded, then subtracted by one every time a reading isn’t equal to or greater than it.

int envelopeValue;

ISR (TIMER1_COMPA_vect) {
    int reading = analogRead(channel);
    envelopeValue = (reading >= envelopeValue) ? reading : envelopeValue - 1;
}

void NeuroBoard::setTriggerOnEnvelope(const unsigned int& threshold, void callback(), const unsigned int& secondFactor=0) {

    // TODO: Call callback when passed threshold is met by envelope value.

    const int THRESHOLD_SCALE_FACTOR = threshold / 10;
    int secondThreshold = secondFactor;

    if (secondFactor == 0) {
        secondThreshold = threshold - THRESHOLD_SCALE_FACTOR;
    }

    if (envelopeValue >= threshold) {
        if (!this->thresholdMet) {
            this->thresholdMet = true;
            callback();
        }
    } else {
        if (envelopeValue <= secondThreshold) {
            this->thresholdMet = false;
        }
    }

}

Note: Because this code is for an Arduino, I cannot use any standard library functions or imports. However, because this section of our code is pure c++, I don’t think it will be an issue. But please consider that if you decide to write an answer. Thanks!

google sheets – Show a specific value in the cell when the two conditions are met

Delete your header “Unit price” from Sheet1!C1 and place the following array formula there instead:

=ArrayFormula({"Unit price";IF(B2:B="",,IFERROR(VLOOKUP(B2:B,Sheet2!A:D,HLOOKUP(E2,{Sheet2!A1:D1;SEQUENCE(1,4)},2,FALSE),FALSE),"NOT FOUND"))})

This formula will create the header.

Under it (as marked by the semicolon), it will first check to see if any cell in B2:B is null/blank. If it is, then nothing happens.

If there is something in any cell from B2:B, the rest of the formula will kick in.

IFERROR(...,"NOT FOUND") will return “NOT FOUND” if there is any problem finding a match. This is only a precaution and should never happen as the sheet is currently set up.

VLOOKUP(B2:B,Sheet2!A:D,...,FALSE)

This will lookup any non-null value in B2:B within the second sheet and “stop at” the row of an exact match. The HLOOKUP (next) will decide which column value to return.

HLOOKUP(E2,{Sheet2!A1:D1;SEQUENCE(1,4)},2,FALSE)

The HLOOKUP decides which column value to return via the VLOOKUP. The HLOOKUP will look for the currency abbreviation within a virtual array made up of the headers from Sheet2 placed above (semicolon) a SEQUENCE of numbers that is 1 row and 4 columns in size (filled, by default, with 1 2 3 4). The second row of this virtual array will be returned, which will wind up being the column number where the currency abbreviation is found.

If the formula does not work, try replacing every comma with a semi-colon, since your locale may require that formatting.

microsoft excel – I need to pull a value from a table when a certain criteria is met but it needs to be a static value and not change as the source data changes

I have a table with live data in it that is calculated based on an underlying dataset and changes regularly.

I want to be able to copy this data into another table every Friday so that I can see the trends week on week. The only problem is that with the formula that I am using as the source data changes so does the data in my trend table. Is there a way that I can use a static value so that it wont change once the source data change like a “Paste Values”.

The current formula I am using to pull the data every Friday is =IF(C3=TODAY(),A3,””) c3 is the date of that Friday. This works but I need it to paste a static value so is there a way to paste the value of A3 on that date instead of referencing what is currently in the cell.

Thanks in advance
Ian