Harringay online

Harringay, Haringey - So Good they Spelt it Twice!

I'm doing a spreadsheet for a charity and I'm a bit stuck getttig right what is probably a very simple formula to someone who works with Excel regularly.

I want to achieve a formula for Cell C

In pidgin Excelese, I want:

IF A1 IS <1 THEN C1 = B1 BUT IF A1 IS>0 THEN C1=A1-B1

or in English, I want:

If Cell A has a value less than 1 then Cell C should equal Cell B, but if Cell A has a value greater than 0 then Cell C shoudl eual Cell A minus Cell B

Can anyone help?

Views: 292

Reply to This

Replies to This Discussion

Chatgpt suggests you can achieve this in Excel using the `IF` function. The formula you'd use in cell C would look like this:

```excel

=IF(A1<1, B1, A1-B1)

```

This formula checks the value in cell A1:

- If the value in cell A1 is less than 1, it sets the value of cell C1 to be equal to the value of cell B1.

- If the value in cell A1 is 1 or greater, it sets the value of cell C1 to be the result of A1 minus B1.

Make sure to adjust the cell references (A1, B1, and C1) to match your actual data.

Thank you, Amit. Much appreciated. I hadn't thought of AI. Guess I need to catch up!

Quick flag that you'd need to be careful with the order of terms here as you have overlapping criteria (i.e., if the A1 is 0.5, do you want it to be B1 or A1-B1).

The way it's currently written will give preference to A1<1, but if you would prefer A1=0.5 to give A1-B1, then you'll need to flip the IF function to IF(A1>0, A1-B1, A1)

Thank you.

You don't need anything a sophisticated as AI. It's in the Excel help file - IF...THEN...ELSE.

RSS

Advertising

© 2024   Created by Hugh.   Powered by

Badges  |  Report an Issue  |  Terms of Service