=IF(And formula

davids4500

New Member
Joined
Jan 14, 2023
Messages
37
Office Version
  1. 365
Platform
  1. Windows
Hi everybody.
I have the formula =IF(AND(E12 = 0,'Sales&ExpensesInfo'!L4>1),'Sales&ExpensesInfo'!L4,IF(AND(E12 > 1,'Sales&ExpensesInfo'!L4>1),E12)).
In the spreadsheet B4 =DATE(YEAR(TODAY()), MONTH(TODAY()), 1) and this is a mmm-yyyy format.
I need to add to the above formula If &TEXT(EDATE(B4, 0),"mmm yyyy" then proceed with the equation,
then i need to repeat If &TEXT(EDATE(B4, 1),"mmm yyyy" then =IF(AND(E68 = 0,'Sales&ExpensesInfo'!M4>1),'Sales&ExpensesInfo'!M4,IF(AND(E68 > 1,'Sales&ExpensesInfo'!M4>1),E68)).
Then repeat repeat If &TEXT(EDATE(B4, 2),"mmm yyyy" then =IF(AND(E106 = 0,'Sales&ExpensesInfo'!b3>1),'Sales&ExpensesInfo'!b3,IF(AND(E106 > 1,'Sales&ExpensesInfo'!b3>1),E106)).

i hope that makes sense and that someone can help me.
Much appreciated
David
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
The syntax you are trying to use to describe what you want isn't making sense to me.

I can't make any sense out of this expression
&TEXT(EDATE(B4, 0),"mmm yyyy"

I suggest that you describe what you actually want to do, rather than showing a bunch of formulas that you think might do it.

Also some other comments:
In the spreadsheet B4 =DATE(YEAR(TODAY()), MONTH(TODAY()), 1) and this is a mmm-yyyy format.
For calculations, it doesn't matter what the display format is. For formulas, the only thing you care about (in 99% of cases) is the actual date, not how it is displayed.

This expression could also be written as
=EOMONTH(TODAY(),-1)+1
You only have to call TODAY once so it's a little more efficient and a little shorter.
 
Upvote 0
Dear Jeff.
Thank you for your reply
I have cash flow spreadsheet for 14 months and with each month there is a cell where we record the sales from the previous year from the sales information on the sheet "sales&ExpensesInfo".
I want to automate the process so that if B4 is November 2024, then excel looks for the sales figures in ='Sales&ExpensesInfo'!L4. Then, for the following month, the cell would look for the following month M4 and so on, taking into account the following month and the new year.
We use the formula:- =IF(AND(E12 = 0,'Sales&ExpensesInfo'!L4>1),'Sales&ExpensesInfo'!L4,IF(AND(E12 > 1,'Sales&ExpensesInfo'!L4>1),E12))., so that we can alter the forcast of the sales without typing over the formula.
I hope that is clearer.
Happy to answer further questions to clarify what i am trying to achieve.
Thak you for your interest.
David
 

Attachments

  • Screenshot 2024-11-17 163143.png
    Screenshot 2024-11-17 163143.png
    127.6 KB · Views: 4
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top